ncs.log Module
This module provides some logging utilities.
Functions
init_logging
init_logging(vmid, log_file, log_level)
Initialize logging
log_datefmt
log_datefmt()
Return date format used in logging.
log_file
log_file()
Return log file used, if any else None
log_format
log_format()
Return log format.
log_handler
log_handler()
Return log handler used, if any else None
mk_log_formatter
mk_log_formatter()
Create log formatter with log and date format setup
reopen_logs
reopen_logs()
Re-open log files if log handler is set
set_log_level
set_log_level(vmid, log_level)
Set log level on the vmid logger and root logger
Classes
class Log
A log helper class.
This class makes it easier to write log entries. It encapsulates another log object that supports Python standard log interface, and makes it easier to format the log message be adding the ability to support multiple arguments.
Example use:
import logging
import confd.log
logger = logging.getLogger(__name__)
mylog = confd.log.Log(logger)
count = 3
name = 'foo'
mylog.debug('got ', count, ' values from ', name)
Log(logobject, add_timestamp=False)
Initialize a Log object.
The argument 'logobject' is mandatory and can be any object which should support as least one of the standard log methods (info, warning, error, critical, debug). If 'add_timestamp' is set to True a time stamp will precede your log message.
Members:
class ParentProcessLogHandler
ParentProcessLogHandler(log_q)
Members:
Last updated
Was this helpful?