PeriodicLogger¶
- class lsst.utils.logging.PeriodicLogger(logger: Logger | LsstLogAdapter, interval: float | None = None, level: int = 20)¶
- Bases: - object- Issue log messages if a time threshold has elapsed. - This class can be used in long-running sections of code where it would be useful to issue a log message periodically to show that the algorithm is progressing. - The first time threshold is counted from object construction, so in general the first call to - logdoes not log.- Parameters:
- loggerlogging.LoggerorLsstLogAdapter
- Logger to use when issuing a message. 
- intervalfloat
- The minimum interval in seconds between log messages. If - None,- LOGGING_INTERVALwill be used.
- levelint, optional
- Log level to use when issuing messages, default is - INFO.
 
- logger
 - Attributes Summary - Default interval between log messages in seconds. - Methods Summary - log(msg, *args)- Issue a log message if the interval has elapsed. - Attributes Documentation - LOGGING_INTERVAL = 600.0¶
- Default interval between log messages in seconds. 
 - Methods Documentation - log(msg: str, *args: Any) bool¶
- Issue a log message if the interval has elapsed. - The interval is measured from the previous call to - log, or from the creation of this object.- Parameters:
- msgstr
- Message to issue if the time has been exceeded. 
- *argsAny
- Arguments to be merged into the message string, as described under - logging.Logger.debug.
 
- msg
- Returns: