Skip to content

salvus.flow.acta.observability.logs

salvus.flow.acta.observability.logs salvus flow acta observability logs

Optional Acta logging with structured event fields.

Records include acta_run, acta_task, acta_key, acta_depth, and acta_kind. Logging is silent until configure_logging is called.

Functions

configure_logging()

def configure_logging(verbosity: int = 0) -> None: ...

Configure terminal logging at the requested verbosity.

Parameters
  • verbosity int = 0 — 0 for warnings only, 1 for one line per task event, 2 (or more) for keys and digests as well.
Returns None

log_event()

def log_event(event: Event, depth: int, logger_name: str) -> None: ...

Emit one ledger event as a log record.

Parameters
  • event Event — The event, as stored.
  • depth int — Its nesting depth, from the ledger’s parent edge.
  • logger_name str — The module logger to emit under, so a host can raise or silence one subsystem.
Returns None

Classes

TreeFormatter

class TreeFormatter(logging.Formatter):
    def __init__(
        self,
        fmt: str | None = None,
        datefmt: str | None = None,
        style: Literal["%", "{", "$"] = "%",
        validate: bool = True,
        defaults: Mapping[str, Any] | None = None,
    ) -> None: ...

Tree formatter.

Initialize the formatter accepted by configure_logging.

Parameters
  • fmt str | None = None — The message format. This formatter renders only the message.
  • datefmt str | None = None — The date format used when fmt includes a timestamp.
  • style Literal['%', '{', '$'] = '%' — The formatting style for fmt.
  • validate bool = True — Whether to validate fmt against style.
  • defaults Mapping[str, Any] | None = None — Default values supplied to the format string.
Methods
format()
def format(self, record: logging.LogRecord) -> str: ...

Render one record as an indented line.

Parameters
  • record logging.LogRecord — The record to render.
Returns str