Logging Module#

SPDX-FileCopyrightText: 2025 DESY and the Constellation authors SPDX-License-Identifier: EUPL-1.2

This module provides a base class for Constellation Satellite modules.

class core.logging.ConstellationLogger(*args: Any, **kwargs: Any)#

Bases: Logger

Custom Logger class for Constellation.

error(msg: str, *args: Any, **kwargs: Any) None#

Map error level to CRITICAL.

status(msg: str, *args: Any, **kwargs: Any) None#

Define level for important information about the host program to the end user with low frequency.

trace(msg: str, *args: Any, **kwargs: Any) None#

Define level for verbose information which allows to follow the call stack of the host program.

class core.logging.ConstellationRichHandler(level: int | str = 0, console: Console | None = None, *, show_time: bool = True, omit_repeated_times: bool = True, show_level: bool = True, show_path: bool = True, enable_link_path: bool = True, highlighter: Highlighter | None = None, markup: bool = False, rich_tracebacks: bool = False, tracebacks_width: int | None = None, tracebacks_code_width: int | None = 88, tracebacks_extra_lines: int = 3, tracebacks_theme: str | None = None, tracebacks_word_wrap: bool = True, tracebacks_show_locals: bool = False, tracebacks_suppress: Iterable[str | ModuleType] = (), tracebacks_max_frames: int = 100, locals_max_length: int = 10, locals_max_string: int = 80, log_time_format: str | Callable[[datetime], Text] = '[%x %X]', keywords: List[str] | None = None)#

Bases: RichHandler

render_message(record: LogRecord, message: str) ConsoleRenderable#

Render message text

class core.logging.ZeroMQSocketLogHandler(transmitter: CMDPPublisher)#

Bases: Handler

This handler sends records to a ZMQ socket.

close() None#

Tidy up any resources used by the handler.

This version removes the handler from an internal map of handlers, _handlers, which is used for handler lookup by name. Subclasses should ensure that this gets called from overridden close() methods.

emit(record: LogRecord) None#

Do whatever it takes to actually log the specified logging record.

This version is intended to be implemented by subclasses and so raises a NotImplementedError.

core.logging.setup_cli_logging(level: str) None#

Sets up the CLI logging configuration