25 from lsst.log import (configure_iface, configure_prop_iface,
26 getDefaultLoggerName_iface, pushContext_iface,
27 popContext_iface, MDC_iface, MDCRemove_iface,
28 getLevel_iface, setLevel_iface,
29 isEnabledFor_iface, forcedLog_iface)
77 frame = inspect.currentframe().f_back
78 for i
in range(depth):
83 return inspect.stack()[depth+1][3]
85 def log(loggername, level, fmt, *args, **kwargs):
87 depth = kwargs[
'depth']
93 path.split(frame.f_code.co_filename)[1],
97 log(
"", TRACE, fmt, *args, depth=2)
100 log(
"", DEBUG, fmt, *args, depth=2)
103 log(
"", INFO, fmt, *args, depth=2)
106 log(
"", WARN, fmt, *args, depth=2)
109 log(
"", ERROR, fmt, *args, depth=2)
112 log(
"", FATAL, fmt, *args, depth=2)
131 if self.
name is not None:
133 if self.
level is not None:
137 if self.
name is not None:
154 logging.Handler.__init__(self)
163 logging.Handler.close(self)
166 if self.context.isEnabledFor(self.
translateLevel(record.levelno)):
167 logging.Handler.handle(self, record)
171 record.funcName, record.lineno, record.msg % record.args)
175 Translates from standard python logging module levels
176 to standard log4cxx levels.
void setLevel_iface(std::string const &loggername, int level)
int getLevel_iface(std::string const &loggername)
void configure_prop_iface(std::string const &properties)
bool isEnabledFor_iface(std::string const &loggername, int level)
void MDCRemove_iface(std::string const &key)
std::string getDefaultLoggerName_iface(void)
void pushContext_iface(std::string const &name)
void MDC_iface(std::string const &key, std::string const &value)
void forcedLog_iface(std::string const &loggername, int level, std::string const &filename, std::string const &funcname, int lineno, std::string const &msg)