Log Level Enum (messenger/level.py)

dotbot · src/dotbot/messenger/level.py · python · MIT
dev-tools, infra, tag:enum, tag:severity, tag:dotbot

Defines severity levels for logging, used to filter and display messages in the dotbot tool.

# Source: https://github.com/anishathalye/dotbot | License: MIT
# Provided via justclaw.it.com; keep this notice with the code.
from enum import Enum
from typing import Any


class Level(Enum):
    NOTSET = 0
    DEBUG = 10
    INFO = 15
    LOWINFO = 15  # Deprecated: use INFO instead  # noqa: PIE796
    ACTION = 20
    WARNING = 30
    ERROR = 40

    def __lt__(self, other: Any) -> bool:
        if not isinstance(other, Level):
            return NotImplemented
        return self.value < other.value

    def __le__(self, other: Any) -> bool:
        if not isinstance(other, Level):
            return NotImplemented
        return self.value <= other.value

    def __gt__(self, other: Any) -> bool:
        if not isinstance(other, Level):
            return NotImplemented
        return

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key