SetupLogging(logfile,
program,
debug=0,
stderr_logging=False,
multithreaded=False,
syslog=constants.SYSLOG_USAGE,
console_logging=False,
root_logger=None)
| source code
|
Configures the logging module.
- Parameters:
logfile (str) - the filename to which we should log
program (str) - the name under which we should log messages
debug (integer) - if greater than zero, enable debug messages, otherwise only those
at INFO and above level
stderr_logging (boolean) - whether we should also log to the standard error
multithreaded (boolean) - if True, will add the thread name to the log file
syslog (string) - one of 'no', 'yes', 'only':
-
if no, syslog is not used
-
if yes, syslog is used (in addition to file-logging)
-
if only, only syslog is used
console_logging (boolean) - if True, will use a FileHandler which falls back to the system
console if logging fails
root_logger (logging.Logger) - Root logger to use (for unittests)
- Returns: callable
- Function reopening all open log files when called
- Raises:
EnvironmentError - if we can't open the log file and syslog/stderr logging is disabled
|