ssb_timeseries.logging
¶
Time series should make use of standardised messaging and logging.
A key principle is that every dataset read or write operation should be logged with log level INFO. The plan is to take this one step further and add stack inspection to enrich the log messages with process identifiers. In that way, logs would provide lineage at the dataset level. Also, adding a log sink to put the (dataset write) messages on a message queue would allow event based workflow definitions.
These are features that may warrant their own shared Dapla libraries. This module serves as a specification of required features byd separates out code that could go into such a library.
- class EnterExitLog(name)¶
Bases:
object
Class supporting decorator to log on enter and exit.
Enter/exit template for workflow process.
- Parameters:
name (str)
- __enter__()¶
Before each workflow process step, do this.
- Return type:
Self
- __exit__(exc_type, exc_value, exc_traceback)¶
After each workflow process step, do this.
- Return type:
None
- __init__(name)¶
Enter/exit template for workflow process.
- Parameters:
name (str)
- Return type:
None
- log_start_stop(func)¶
Log start and stop of decorated function.
- Return type:
Callable
- Parameters:
func (Callable)