wy_qcos.log package
Submodules
wy_qcos.log.logger module
- class wy_qcos.log.logger.ColouredFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)
基类:
FormatterColoured Formatter for logger module.
- RESET = '\x1b[0m'
- WHITE = '\x1b[37m'
- RED = '\x1b[31m'
- YELLOW = '\x1b[33m'
- GREY = '\x1b[38m'
- format(record, colour=False)
Format log record.
- class wy_qcos.log.logger.ColouredStreamHandler(stream=None)
基类:
StreamHandlerColoured Stream Handler for logger module.
- format(record, colour=False)
Format the specified record.
If a formatter is set, use it. Otherwise, use the default formatter for the module.
- emit(record)
Emit a record.
If a formatter is specified, it is used to format the record. The record is then written to the stream with a trailing newline. If exception information is present, it is formatted using traceback.print_exception and appended to the stream. If the stream has an 'encoding' attribute, it is used to determine how to do the output to the stream.
- class wy_qcos.log.logger.LogFilter(name='')
基类:
FilterThis filter some noise from the logs.
- filter(record)
Determine if the specified record is to be logged.
Returns True if the record should be logged, or False otherwise. If deemed appropriate, the record may be modified in-place.
- class wy_qcos.log.logger.CompressedRotatingFileHandler(filename, mode='a', maxBytes=0, backupCount=0, encoding=None, delay=False, errors=None)
基类:
RotatingFileHandlerCustom rotating file handler with compression support.
- doRollover()
Do a rollover, as described in __init__().
- wy_qcos.log.logger.init_logger(level, *, logfile=None, max_bytes=10000000, backup_count=10, console=True, compression=True, quiet=False)