Source code for app.util.logging.formatters

# SPDX-License-Identifier: GPLv3-or-later
# Copyright © 2025 pygaindalf Rui Pinheiro

import logging

from typing import override


[docs] class ConditionalFormatter(logging.Formatter):
[docs] @override def format(self, record: logging.LogRecord) -> str: simple = getattr(record, "simple", False) if simple: return record.getMessage() else: return super().format(record)