fenn.logging¶

- class fenn.logging.FennHandler(level=0)[source]¶
Bases:
XmlMixin,Handler- Parameters:
level (int)
- class fenn.logging.FennLogger(logger, handler)[source]¶
Bases:
XmlMixin,LoggerAdapter- Parameters:
logger (Logger)
handler (FennHandler)
- __init__(logger, handler)[source]¶
- Parameters:
logger (Logger)
handler (FennHandler)
- Return type:
None
- fn_file: Path¶
- handler: FennHandler¶
- log_metric(name, value, step)[source]¶
Appends a structured <metric> entry to the run’s .fn file.
name accepts any string and is persisted as-is (e.g. “train_loss”, “val_loss”, “acc” - the values fenn’s built-in trainers emit).
- Parameters:
name (str)
value (float)
step (int)
- Return type:
None
- process(msg, kwargs)[source]¶
Process the logging message and keyword arguments passed in to a logging call to insert contextual information. You can either manipulate the message itself, the keyword args or both. Return the message and kwargs modified (or not) to suit your needs.
Normally, you’ll only need to override this one method in a LoggerAdapter subclass for your specific needs.
- Parameters:
msg (str)
kwargs (MutableMapping[str, Any])
- Return type:
tuple[str, MutableMapping[str, Any]]
- txt_file: Path¶