logInfo¶
-
lsst.utils.timer.logInfo(obj: Any, prefix: str, logLevel: int = 10, metadata: Optional[MutableMapping[KT, VT]] = None, logger: Optional[logging.Logger] = None) → None¶ Log timer information to
obj.metadataandobj.log.Parameters: - obj :
object An object with both or one these two attributes:
metadataadict-like container for storing metadata. Can use theadd(name, value)method if found, else will append entries to a list.logan instance oflogging.Loggeror subclass.
If
None, at least one ofmetadataorloggershould be passed or this function will do nothing.- prefix :
str Name prefix, the resulting entries are
CpuTime, etc.. For exampletimeMethodusesprefix = Startwhen the method begins andprefix = Endwhen the method ends.- logLevel : optional
Log level (a
logginglevel constant, such aslogging.DEBUG).- metadata :
collections.abc.MutableMapping, optional Metadata object to write entries to, overriding
obj.metadata.- logger :
logging.Logger Log object to write entries to, overriding
obj.log.
Notes
Logged items include:
Utc: UTC date in ISO format (only in metadata since log entries have timestamps).CpuTime: System + User CPU time (seconds). This should only be used- in differential measurements; the time reference point is undefined.
MaxRss: maximum resident set size.
All logged resource information is only for the current process; child processes are excluded.
- obj :