annalist package¶
Submodules¶
annalist.annalist module¶
Main module.
- class annalist.annalist.Annalist(*args, **kw)[source]¶
Bases:
objectAnnalist Class.
Attributes¶
- loggerAnnalistLogger
A custom subclass of logging.Logger which allows additional user-defined variables to be parsed from the formatter and added dynamically.
- stream_handlerlogging.StreamHandler
Logging handler that sends output to streams such as sys.stdout, sys.stderr, etc. Will be passed the stream_formatter attribute. See documentation for logging.StreamHandler for more info.
- file_handlerlogging.FileHandler
Logging handler that sends output to the logfile defined by the logfile attribute. Will be passed the file_formatter attribute. See `logging.FileHandler documentation`_ for more info.
- stream_formatterstr
Stream formatting string to be parsed by logging.Formatter. Used to set up stream_handler. See `logging.Formatter documentation`_ for more info.
- file_formatterstr
File formatting string to be parsed by logging.Formatter. See `logging.Formatter documentation`_ for more info.
- property analyst_name¶
The analyst_name property.
- configure(logfile: str | PathLike[str] | None = None, analyst_name: str | None = None, file_format_str: str | None = None, stream_format_str: str | None = None, level_filter: str = 'INFO', default_level: str = 'INFO')[source]¶
Configure the Annalist.
- property default_level¶
The default_level property.
- property level_filter¶
The level_filter property.
- static parse_formatter(format_string)[source]¶
Parse a formatting string.
Extracts field names from a formatting string. Only printf-style (%-style) strings are supported.
Parameters¶
- format_stringstr
A printf-style (%-style) string.
Returns¶
- list
A list of parameter names in the order that they appear in the format string.
- class annalist.annalist.AnnalistLogger(name, extra_attributes)[source]¶
Bases:
LoggerCustom Logger class to add contextual information.
Module contents¶
Top-level package for Annalist.