loggers

cpp_linter.loggers.logger = <Logger CPP Linter (WARNING)>

The logging.Logger object used for outputting data.

cpp_linter.loggers.start_log_group(name: str) None[source]

Begin a collapsible group of log statements.

Parameters:
name: str

The name of the collapsible group

cpp_linter.loggers.end_log_group() None[source]

End a collapsible group of log statements.

cpp_linter.loggers.log_response_msg(response: Response)[source]

Output the response buffer’s message on a failed request.

cpp_linter.loggers.should_use_rich() bool[source]

Decide whether log output should be rendered with rich.

Call this in the parent process and hand the result to worker processes. With the forkserver start method (the default on Linux since Python 3.14) workers inherit the environment of the long-lived forkserver, not the parent’s current environment, so a check of os.environ inside the worker can be stale.

cpp_linter.loggers.worker_log_init(log_lvl: int, use_rich: bool | None = None)[source]

Set up logging inside a worker process.

Parameters:
log_lvl: int

The log level to apply; passed in because Windows does not copy the parent’s log level to subprocesses.

use_rich: bool | None = None

Whether to render logs with rich. Compute this in the parent with should_use_rich() and pass it in; None falls back to evaluating it in the current process.