libmuscle.manager.logger module¶
- class libmuscle.manager.logger.Formatter(fmt=None, datefmt=None, style='%')[source]¶
Bases:
Formatter
A custom formatter that can format remote messages.
Initialize the formatter with specified format strings.
Initialize the formatter either with the specified format string, or a default as described above. Allow for specialized date formatting with the optional datefmt argument. If datefmt is omitted, you get an ISO8601-like (or RFC 3339-like) format.
Use a style parameter of ‘%’, ‘{’ or ‘$’ to specify that you want to use one of %-formatting,
str.format()
({}
) formatting orstring.Template
formatting in your format string.Changed in version 3.2: Added the
style
parameter.
- class libmuscle.manager.logger.Logger(log_dir: Optional[Path] = None)[source]¶
Bases:
object
The MUSCLE 3 Manager Logger component.
The Logger component takes log messages and writes them to standard out.
- Parameters
log_dir – Directory to write the log file into.
- log_message(instance_id: str, timestamp: Timestamp, level: LogLevel, text: str) None [source]¶
Log a message.
- Parameters
instance_id – Identifier of the instance that generated the message.
timestamp – Time when this log message was generated, according to the clock on that machine.
level – The log level of the message.
text – The message text.