logInfo¶
- lsst.utils.timer.logInfo(obj: Any, prefix: str, logLevel: int = 10, metadata: MutableMapping | None = None, logger: Logger | None = None, stacklevel: int | None = None) None¶
- Log timer information to - obj.metadataand- obj.log.- Parameters:
- objobject
- An object with both or one these two attributes: - metadataa- dict-like container for storing metadata. Can use the- add(name, value)method if found, else will append entries to a list.
- logan instance of- logging.Loggeror subclass.
 - If - None, at least one of- metadataor- loggershould be passed or this function will do nothing.
- prefixstr
- Name prefix, the resulting entries are - CpuTime, etc.. For example- timeMethoduses- prefix = Startwhen the method begins and- prefix = Endwhen the method ends.
- logLeveloptional
- Log level (a - logginglevel constant, such as- logging.DEBUG).
- metadatacollections.abc.MutableMapping, optional
- Metadata object to write entries to, overriding - obj.metadata.
- loggerlogging.Logger
- Log object to write entries to, overriding - obj.log.
- stacklevelint, optional
- The stack level to pass to the logger to adjust which stack frame is used to report the file information. If - Nonethe stack level is computed such that it is reported as the first package outside of the utils package. If a value is given here it is adjusted by 1 to account for this caller.
 
- obj
 - 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. Always in bytes.
 - All logged resource information is only for the current process; child processes are excluded. - The metadata will be updated with a - __version__field to indicate the version of the items stored. If there is no version number it is assumed to be version 0.- Version 0: - MaxResidentSetSizeunits are platform-dependent.
- Version 1: - MaxResidentSetSizewill be stored in bytes.