drytorch.trackers.logging
Module containing custom logging configurations for the ‘drytorch’ logger.
It defines and implements a formatter that formats log messages according to the levels defined in the INFO_LEVELS variable. By default, it prints to stream and does not propagate to the main root.
- INFO_LEVELS
InfoLevels object for global settings.
Functions
Disable the handler and filter of the local logger. |
|
Revert the changes made by enable_propagation. |
|
|
Set up the default logging configuration. |
|
Propagate to the root logger. |
Get the verbosity level of the 'drytorch' logger. |
|
|
Set the formatter for the stream handler of the drytorch logger. |
|
Set the verbosity level of the 'drytorch' logger. |
Classes
Tracker that streams logging messages through the built-in logger. |
|
Filter that excludes logs from 'drytorch'. |
|
Default formatter for the drytorch logger. |
|
|
Dataclass that defines different levels of information for logging. |
Formatter that dynamically overwrites metrics and epoch logs. |
- class BuiltinLogger[source]
Bases:
TrackerTracker that streams logging messages through the built-in logger.
- notify(event: Event) None[source]
- notify(event: StartTrainingEvent) None
- notify(event: EndTrainingEvent) None
- notify(event: StartEpochEvent) None
- notify(event: EndEpochEvent) None
- notify(event: SaveModelEvent) None
- notify(event: LoadModelEvent) None
- notify(event: MetricEvent) None
- notify(event: StartTestEvent) None
- notify(event: EndTestEvent) None
- notify(event: TerminatedTrainingEvent) None
- notify(event: StartExperimentEvent) None
- notify(event: StopExperimentEvent) None
- notify(event: LearningRateEvent) None
- notify(event: ModelRegistrationEvent) None
- notify(event: ActorRegistrationEvent) None
Notify the tracker of an event.
- Parameters:
event (Event) – the event to notify about.
- Return type:
None
- class DryTorchFormatter[source]
Bases:
FormatterDefault formatter for the drytorch logger.
Initialize.
- class InfoLevels(internal: int, metrics: int, epoch: int, model_state: int, experiment: int, training: int, test: int)[source]
Bases:
objectDataclass that defines different levels of information for logging.
- Parameters:
- class ProgressFormatter[source]
Bases:
DryTorchFormatterFormatter that dynamically overwrites metrics and epoch logs.
Initialize.
- disable_default_handler() None[source]
Disable the handler and filter of the local logger.
- Return type:
None
- disable_propagation() None[source]
Revert the changes made by enable_propagation.
- Return type:
None
- enable_default_handler(stream: SupportsWrite[str] = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>) None[source]
Set up the default logging configuration.
- Parameters:
stream (SupportsWrite[str])
- Return type:
None
- enable_propagation(deduplicate_stream: bool = True) None[source]
Propagate to the root logger.
- Parameters:
deduplicate_stream (bool) – whether to remove local messages from the stream.
- Return type:
None