ogstools.logparser.log_file_handler module#

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

Bases: FileSystemEventHandler

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.

Line_limit:

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

__init__(file_name, queue, status, stop_callback, 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.

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.

Return type:

None

on_modified(event)[source]#

Called when a file or directory is modified.

Parameters:

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

Return type:

None

process()[source]#
Return type:

None