autoencoder.logger
#
Logging levels: CRITICAL 50 ERROR 40 WARNING 30 INFO 20 DEBUG 10 NOTSET 0
Module Contents#
Classes#
Initialize self. See help(type(self)) for accurate signature. |
|
Initialize the adapter with a logger and a dict-like object which |
|
Initialize the formatter with specified format strings. |
Functions#
Create a logger with a stream handler and a file handler |
|
|
Attributes#
- autoencoder.logger.LOGGER_NAME = MUDI#
- autoencoder.logger.FORMATTER = %(asctime)s - %(name)s - %(levelname)s - %(message)s (%(filename)s:%(lineno)d)#
- class autoencoder.logger.BraceString#
Bases:
str
Initialize self. See help(type(self)) for accurate signature.
- __mod__(self, other)#
Return self%value.
- __str__(self)#
Return str(self).
- class autoencoder.logger.StyleAdapter(logger, extra=None)#
Bases:
logging.LoggerAdapter
Initialize the adapter with a logger and a dict-like object which provides contextual information. This constructor signature allows easy stacking of LoggerAdapters, if so desired.
You can effectively pass keyword arguments as shown in the following example:
adapter = LoggerAdapter(someLogger, dict(p1=v1, p2=”v2”))
- process(self, msg, kwargs)#
Process the logging message and keyword arguments passed in to a logging call to insert contextual information. You can either manipulate the message itself, the keyword args or both. Return the message and kwargs modified (or not) to suit your needs.
Normally, you’ll only need to override this one method in a LoggerAdapter subclass for your specific needs.
- class autoencoder.logger.ColorFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)#
Bases:
logging.Formatter
Initialize the formatter with specified format strings.
Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument. If datefmt is omitted, you get an ISO8601-like (or RFC 3339-like) format.
Use a style parameter of ‘%’, ‘{’ or ‘$’ to specify that you want to use one of %-formatting,
str.format()
({}
) formatting orstring.Template
formatting in your format string.Changed in version 3.2: Added the
style
parameter.- grey = [38;21m#
- yellow = [33;21m#
- red = [31;21m#
- bold_red = [31;1m#
- reset = [0m#
- FORMATS#
- format(self, record)#
Format the specified record as text.
The record’s attribute dictionary is used as the operand to a string formatting operation which yields the returned string. Before formatting the dictionary, a couple of preparatory steps are carried out. The message attribute of the record is computed using LogRecord.getMessage(). If the formatting string uses the time (as determined by a call to usesTime(), formatTime() is called to format the event time. If there is exception information, it is formatted using formatException() and appended to the message.
- Parameters
record (logging.LogRecord) –
- Return type
str
- autoencoder.logger.get_logger()#
Create a logger with a stream handler and a file handler
- Return type
None
- autoencoder.logger.set_log_level(log_level)#
- Parameters
log_level (int) –
- Return type
None
- autoencoder.logger.logger#