Skip to content

types

log_panel.types

LogLevel

Bases: StrEnum

Valid log level values, derived from Python's logging module constants.

CardFilter

Bases: StrEnum

Valid filter values for the cards dashboard.

SlotStatus

Bases: StrEnum

Color-coded status for a single timeline slot.

RangeUnit

Bases: StrEnum

Supported timeline bucket sizes.

RangeConfig(delta, unit, slots, format, label=None) dataclass

Typed configuration for a single admin timeline range.

from_value(value) classmethod

Normalise a raw settings value into a typed range config.

Source code in log_panel/types.py
@classmethod
def from_value(cls, value: "RangeConfig | Mapping[str, Any]") -> "RangeConfig":
    """Normalise a raw settings value into a typed range config."""
    if isinstance(value, cls):
        return value

    raw: Mapping[str, Any] = cast(typ=Mapping[str, Any], val=value)
    return cls(
        delta=raw["delta"],
        unit=RangeUnit(value=raw["unit"]),
        slots=raw["slots"],
        format=raw["format"],
        label=raw.get("label"),
    )

ThresholdAlertEvent(logger_name, threshold_level, record_level, threshold, matching_count, timestamp, window_start, window_end, message, module, pathname, line_number) dataclass

Payload emitted when a logger crosses a configured threshold.

MessageParts(preview, chunks, size) dataclass

Structured representation of a stored log message.