lsst.log

The lsst.log module provides logging for C++ and Python.

Contributing

lsst.log is developed at https://github.com/lsst/log. You can find Jira issues for this module under the log component.

Python API reference

lsst.log Package

Functions

MDC(key, value)
MDCRegisterInit(func)
MDCRemove(key)
configure(*args)
configure_prop(properties)
configure_pylog_MDC(level, MDC_class, …) Configure log4cxx to send messages to Python logging, with MDC support.
critical(fmt, *args)
debug(fmt, *args)
debugf(fmt, *args, **kwargs)
doNotUsePythonLogging()
error(fmt, *args)
errorf(fmt, *args, **kwargs)
fatal(fmt, *args)
fatalf(fmt, *args, **kwargs)
getDefaultLogger()
getEffectiveLevel(loggername)
getLevel(loggername)
getLevelName(level) Return the name associated with this logging level.
getLogger(loggername)
info(fmt, *args)
infof(fmt, *args, **kwargs)
isEnabledFor(loggername, level)
log(loggername, level, fmt, *args, **kwargs)
logf(loggername, level, fmt, *args, **kwargs)
lwpID()
setLevel(loggername, level)
trace(fmt, *args)
tracef(fmt, *args, **kwargs)
usePythonLogging()
warn(fmt, *args)
warnf(fmt, *args, **kwargs)
warning(fmt, *args)

Classes

LevelTranslator Helper class to translate levels between lsst.log and Python logging.
Log
LogHandler([level]) Handler for Python logging module that emits to LSST logging.
MDCDict Dictionary for MDC data.
UsePythonLogging() Context manager to enable Python log forwarding temporarily.

lsst.log.utils Module

Functions

traceSetAt(name, number) Adjusts logging level to display messages with the trace number being less than or equal to the provided value.
temporaryLogLevel(name, level) A context manager that temporarily sets the level of a Log.
enable_notebook_logging([dest]) Enable notebook output for log4cxx messages.
disable_notebook_logging() Stop notebook output for log4cxx messages.

Classes

LogRedirect([fd, dest, encoding, errors]) Redirect a logging file descriptor to a Python stream.