increases the current section depth for subsequent log messages, and ensures that the section depth is decreased again when exiting the context. Args: level: The log level. message: The title message to log. *args: The arguments to the message. Use `LazyString` to defer the expensive evaluation of the arguments until the message is actually logged. **kwargs: The keyword arguments for `logging.Logger.log`. Yields: None: This context manager does not yield any value. Example: >>> with DiagnosticContext("DummyContext", "1.0"): ... rule = infra.Rule("RuleID", "DummyRule", "Rule message") ... diagnostic = Diagnostic(rule, infra.Level.WARNING) ... with diagnostic.log_section(logging.INFO, "My Section"): ... diagnostic.log(logging.INFO, "My Message") ... with diagnostic.log_section(logging.INFO, "My Subsection"): ... diagnostic.log(logging.INFO, "My Submessage") ... diagnostic.additional_messages ['## My Section', 'My Message', '### My Subsection', 'My Submessage'] z