getLogger¶
-
lsst.utils.logging.getLogger(name: Optional[str] = None, logger: Optional[logging.Logger] = None) → lsst.utils.logging.LsstLogAdapter¶ Get a logger compatible with LSST usage.
Parameters: - name :
str, optional Name of the logger. Root logger if
None.- logger :
logging.LoggerorLsstLogAdapter If given the logger is converted to the relevant logger class. If
nameis given the logger is assumed to be a child of the supplied logger.
Returns: - logger :
LsstLogAdapter The relevant logger.
Notes
A
logging.LoggerAdapteris used since it is easier to provide a more uniform interface than when usinglogging.setLoggerClass. An adapter can be wrapped around the root logger and thesetLoggerClasswill return the logger first given that name even if the name was used before theTaskwas created.- name :