astromodels.utils.logging module¶
- class astromodels.utils.logging.ColoredFormatter(fmt, datefmt=None, style='%', log_colors=None, reset=True, secondary_log_colors=None)[source]¶
Bases:
logging.Formatter
A formatter that allows colors to be placed in the format string. Intended to help in creating more readable logging output. Based on https://github.com/borntyping/python-colorlog
- class astromodels.utils.logging.ColoredRecord(record)[source]¶
Bases:
object
Wraps a LogRecord, adding named escape codes to the internal dict. The internal dict is used when formatting the message (by the PercentStyle, StrFormatStyle, and StringTemplateStyle classes).
- astromodels.utils.logging.activate_warnings()[source]¶
supress warning messages in console and file usr logs
- astromodels.utils.logging.escape_codes(log_colors, level_name)[source]¶
Return escape codes from a
log_colors
dict.
- astromodels.utils.logging.get_path_of_log_file(log_file: str) pathlib.Path [source]¶
returns the path of the log files
- astromodels.utils.logging.hash_coloured(text)[source]¶
Return a ANSI coloured text based on its hash
- astromodels.utils.logging.hash_coloured_escapes(text)[source]¶
Return the ANSI hash colour prefix and suffix for a given text
- astromodels.utils.logging.parse_colors(sequence)[source]¶
Return escape codes from a color sequence.