crumpets.logging module¶
- class crumpets.logging.JSONLogger(name, filename, level=0)[source]¶
Bases:
logging.Logger
A subclass of the default Python Logger that uses the JSONLines output format.
- critical(**kwargs)[source]¶
Log ‘msg % args’ with severity ‘CRITICAL’.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.critical(“Houston, we have a %s”, “major disaster”, exc_info=1)
- debug(**kwargs)[source]¶
Log ‘msg % args’ with severity ‘DEBUG’.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.debug(“Houston, we have a %s”, “thorny problem”, exc_info=1)
- error(**kwargs)[source]¶
Log ‘msg % args’ with severity ‘ERROR’.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.error(“Houston, we have a %s”, “major problem”, exc_info=1)
- exception(exc_info=True, **kwargs)[source]¶
Convenience method for logging an ERROR with exception information.
- fatal(**kwargs)¶
Log ‘msg % args’ with severity ‘CRITICAL’.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.critical(“Houston, we have a %s”, “major disaster”, exc_info=1)
- info(**kwargs)[source]¶
Log ‘msg % args’ with severity ‘INFO’.
To pass exception information, use the keyword argument exc_info with a true value, e.g.
logger.info(“Houston, we have a %s”, “interesting problem”, exc_info=1)
- class crumpets.logging.SilentLogger[source]¶
Bases:
object
Replacement logger for a logger that does not log anything. Useful when running multiple processes, but not all of them should log results.
- fatal(**kwargs)¶
- crumpets.logging.get_logfilename(prefix='', dateformat='%Y-%m-%dt%H-%M-%S', pathformat='%s%s.log')[source]¶
- crumpets.logging.make_printer(bar_format='{desc} {percentage:3.0f}% {elapsed}<{remaining}, {rate_fmt}{postfix}', miniters=0, mininterval=0.5, smoothing=0.1, file=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>, **kwargs)[source]¶
Create a ProgressPrinter with appropriate parameters for training. See tqdm documentation for details on parameters. :return: