spine.utils.logger

SPINE logging setup and rank-aware output filtering.

Functions

configure_rank_logging([rank])

Configure the global SPINE logger to emit INFO logs on the main rank.

Classes

MainProcessFilter([rank])

Suppress low-priority log records from non-main distributed ranks.

class spine.utils.logger.MainProcessFilter(rank: int | None = None)[source]

Suppress low-priority log records from non-main distributed ranks.

Methods

filter(record)

Return True when a record should be emitted.

filter(record: LogRecord) bool[source]

Return True when a record should be emitted.

spine.utils.logger.configure_rank_logging(rank: int | None = None) None[source]

Configure the global SPINE logger to emit INFO logs on the main rank.

Parameters:

rank (int, optional) – Current process rank. None and 0 emit all records. Positive ranks suppress records below WARNING unless the log call provides extra={"all_ranks": True}.