Skip to content

logging

konigle.logging

Logging configuration and utilities for the Konigle SDK.

This module provides centralized logging setup with support for both development and production environments, structured logging, and integration with the SDK's configuration system.

KonigleLogger

Centralized logging configuration for the SDK.

add_handler(handler) classmethod

Add custom logging handler.

PARAMETER DESCRIPTION
handler

Custom logging handler to add

TYPE: Handler

configure_for_development() classmethod

Configure logging for development with detailed output.

configure_for_production() classmethod

Configure logging for production with structured JSON output.

get_logger() classmethod

Get configured logger instance.

RETURNS DESCRIPTION
Logger

Configured logger instance for the SDK

set_level(level) classmethod

Set logging level.

PARAMETER DESCRIPTION
level

Logging level as string or integer constant

TYPE: Union[str, int]

add_handler(handler)

Add a custom logging handler.

PARAMETER DESCRIPTION
handler

Custom logging handler to add to the SDK logger

TYPE: Handler

configure_logging(development=False)

Configure logging for environment.

PARAMETER DESCRIPTION
development

If True, configure for development with detailed output. If False, configure for production with JSON structured logs.

TYPE: bool DEFAULT: False

get_logger()

Get the main Konigle logger.

RETURNS DESCRIPTION
Logger

Main logger instance for the SDK

set_log_level(level)

Set SDK logging level.

PARAMETER DESCRIPTION
level

Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL) as string or integer constant

TYPE: Union[str, int]