ogstools.logparser.log_file_handler module#

class ogstools.logparser.log_file_handler.LogFileHandler[source]#

Bases: FileSystemEventHandler

Parameters:
  • file_name – The location of the log file to monitor.

  • queue – The queue where log entries are put and to be consumed.

Status:

The status of the simulation (e.g. current time step).

Stop_callback:

A callback function to stop the simulation.

Force_parallel:

Only needed for MPI run with 1 process. Then it must be set to True.

Line_limit:

The number of lines to read before stopping the simulation. 0 means no limit.

__init__(file_name, queue, status, stop_callback, force_parallel=False, line_limit=0)[source]#
Parameters:
  • file_name (str | Path) – The location of the log file to monitor.

  • queue (Queue) – The queue where log entries are put and to be consumed.

Status:

The status of the simulation (e.g. current time step).

Stop_callback:

A callback function to stop the simulation.

Force_parallel:

Only needed for MPI run with 1 process. Then it must be set to True.

Line_limit:

The number of lines to read before stopping the simulation. 0 means no limit.

on_created(event)[source]#

Called when a file or directory is created.

Parameters:

event (DirCreatedEvent or FileCreatedEvent) – Event representing file/directory creation.

on_modified(event)[source]#

Called when a file or directory is modified.

Parameters:

event (DirModifiedEvent or FileModifiedEvent) – Event representing file/directory modification.

process()[source]#