cambrian.utils.logger¶
Provides a custom logger object.
Should be used like the following:
from cambrian.utils.logger import get_logger
get_logger().fatal("Fatal")
get_logger().error("Error")
get_logger().warn("Warning")
get_logger().info("Information")
get_logger().debug("Debug")
Classes¶
A file handler which creates the directory if it doesn't exist. |
|
A handler that uses tqdm.write to log messages. |
|
This filter sets a maximum level. |
|
This filter allows a message to be logged only once. |
Module Contents¶
- class MjCambrianFileHandler(filename, *args, **kwargs)[source]¶
Bases:
logging.FileHandler
A file handler which creates the directory if it doesn’t exist.
- class MjCambrianTqdmStreamHandler(stream=None)[source]¶
Bases:
logging.StreamHandler
A handler that uses tqdm.write to log messages.
- emit(record)[source]¶
Emit a record.
If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an ‘encoding’ attribute, it is used to determine how to do the output to the stream.
- class MjCambrianLoggerMaxLevelFilter(max_level)[source]¶
Bases:
logging.Filter
This filter sets a maximum level.