pyfcstm.entry.simulate.logging
Entry-side logging presentation helpers for simulate CLI.
This module configures the runtime logger (pyfcstm.simulate) with CLI-specific presentation handlers. The entry layer and runtime share the same logger instance to ensure consistent highlighting and formatting.
SimulatePlainLogHandler
SimulateLogHighlighter
SimulateRichLogHandler
SimulateCliFormatter
- class pyfcstm.entry.simulate.logging.SimulateCliFormatter[source]
Formatter for simulate CLI log messages.
The entry layer owns all simulate CLI formatting, using the compact form
[%(levelname)s] %(message)srequested by the user.- __init__()[source]
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.Templateformatting in your format string.Changed in version 3.2: Added the
styleparameter.
create_simulate_log_handler
- pyfcstm.entry.simulate.logging.create_simulate_log_handler(use_color: bool = True) Handler[source]
Create a CLI log handler for simulate output.
Uses Rich when colors are enabled. Falls back to a plain standard-library handler otherwise.
- Parameters:
use_color (bool) – Whether colored terminal output is enabled.
- Returns:
Configured logging handler.
- Return type:
logging.Handler
configure_simulate_cli_logger
- pyfcstm.entry.simulate.logging.configure_simulate_cli_logger(logger: Logger, use_color: bool = True) None[source]
Configure a runtime logger for CLI presentation.
This function configures the runtime logger (typically pyfcstm.simulate) with CLI-specific handlers and formatting. Both the entry layer and runtime share this logger instance, ensuring consistent highlighting and formatting across all log messages.
This function replaces existing handlers with a single CLI-facing handler so output is not duplicated when multiple command processors are created.
- Parameters:
logger (logging.Logger) – Runtime logger to configure (typically runtime.logger).
use_color (bool) – Whether colored terminal output is enabled.
- Returns:
None.- Return type:
None