"""Logging infrastructure for NoteFlow.

This module provides centralized logging with structlog, supporting:
- Dual output (Rich console for development, JSON for observability)
- Automatic context injection (request_id, user_id, workspace_id)
- OpenTelemetry trace correlation
- In-memory log buffer for UI streaming
- Timing helpers for operation duration logging
- State transition logging for entity lifecycle tracking
"""

from .config import (
    LoggingConfig,
    configure_logging,
    create_renderer,
    get_log_level,
    get_logger,
)
from .log_buffer import LogBuffer, LogBufferHandler, LogEntry, get_log_buffer
from .processors import add_noteflow_context, add_otel_trace_context
from .structured import (
    generate_request_id,
    get_logging_context,
    get_request_id,
    get_user_id,
    get_workspace_id,
    request_id_var,
    user_id_var,
    workspace_id_var,
)
from .timing import log_timing, timed
from .transitions import log_state_transition

__all__ = [
    "LogBuffer",
    "LogBufferHandler",
    "LogEntry",
    "LoggingConfig",
    "add_noteflow_context",
    "add_otel_trace_context",
    "configure_logging",
    "create_renderer",
    "generate_request_id",
    "get_log_buffer",
    "get_log_level",
    "get_logger",
    "get_logging_context",
    "get_request_id",
    "get_user_id",
    "get_workspace_id",
    "log_state_transition",
    "log_timing",
    "request_id_var",
    "timed",
    "user_id_var",
    "workspace_id_var",
]
