PrecisionLogFormatter#

class lsst.daf.butler.cli.cliLog.PrecisionLogFormatter(fmt=None, datefmt=None, style='%', validate=True, *, defaults=None)#

Bases: Formatter

A log formatter that issues accurate timezone-aware timestamps.

Attributes Summary

use_local

Control whether local time is displayed instead of UTC.

Methods Summary

converter

timestamp[, tz] -> tz's local time from POSIX timestamp.

formatTime(record[, datefmt])

Format the time as an aware datetime.

Attributes Documentation

use_local = True#

Control whether local time is displayed instead of UTC.

Methods Documentation

converter()#

timestamp[, tz] -> tz’s local time from POSIX timestamp.

formatTime(record: LogRecord, datefmt: str | None = None) str#

Format the time as an aware datetime.

Parameters#

recordlogging.LogRecord

The record to format.

datefmtstr or None, optional

Format to use when formatting the date.

Returns#

formattedstr

Formatted date string.