pypz.plugins.loggers.default module
- class pypz.plugins.loggers.default.DefaultLoggerPlugin(name: str = None, *args, **kwargs)
Bases:
LoggerPlugin,DefaultContextLoggerThis is the default implementation of the
LoggerPlugininterface. It actually does not implement anything, but uses theDefaultContextLogger. This is possible, since both implements theContextLoggerInterface.- Parameters:
name – name of the instance, if not provided, it will be attempted to deduce from the variable’s name
- __logger: ContextLogger | None
Context logger, which is the Operator’s logger if Operator context existing, otherwise it defaults back to the DefaultContextLogger. Note that Plugin without Operator context makes only sense in test cases, hence the default log level is set to DEBUG.
- _abc_impl = <_abc._abc_data object>
- _log_level
Convenience class to represent an optional parameter Usage:
class TestImpl(Instance): required_param = RequiredParameter(str) optional_param = OptionalParameter(str) def __init__(self): self.required_param = None self.optional_param = "defaultValue"
- Parameters:
parameter_type – (str, int, float, set, list, dict, type(None))
alt_name – alternative name for the parameter, if specified it acts as reference to the parameter
on_update – callback to react on value update
- _on_error(source: Any, exception: Exception) None
This method can be implemented to react to error events during execution. The error itself may come from arbitrary sources.
- _on_interrupt(system_signal: int = None) None
This method can be implemented to react to interrupt signals like SIGINT, SIGTERM etc. The specs implementation can then execute interrupt logic e.g., early termination of loops.
- Parameters:
system_signal – id of the system signal that causes interrupt