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

format(record)[source]

Format a message from a record object.

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).

class astromodels.utils.logging.LogFilter(level)[source]

Bases: object

filter(logRecord)[source]
astromodels.utils.logging.activate_warnings()[source]

supress warning messages in console and file usr logs

astromodels.utils.logging.esc(*x)[source]

Create escaped code from format code

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_dir()[source]
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.

astromodels.utils.logging.setup_logger(name)[source]
astromodels.utils.logging.silence_warnings()[source]

supress warning messages in console and file usr logs

astromodels.utils.logging.update_logging_level(level)[source]