### CoreLog Minimal Development Environment Setup Source: https://github.com/el-peppo/corelog_min/blob/master/CLAUDE.md This snippet provides essential `bash` commands for setting up the CoreLog Minimal development environment. It includes instructions for installing the library in editable mode, running basic unit tests, executing a comprehensive suite of integration tests, and building distribution packages. ```bash pip install -e . python test_minimal.py python test_integration.py python -m build ``` -------------------------------- ### Install CoreLog Minimal via pip Source: https://github.com/el-peppo/corelog_min/blob/master/README.md Instructions to install the CoreLog Minimal library in editable mode using pip, typically for development or local project integration. ```bash pip install -e . ``` -------------------------------- ### Configure CoreLog Minimal via YAML Source: https://github.com/el-peppo/corelog_min/blob/master/README.md Example YAML configuration for CoreLog Minimal, setting the global logger level, enabling/disabling console, file, and remote handlers, and defining top-level remote logging parameters. ```yaml logger: level: INFO handlers: console: true file: false remote: false # Remote handler configuration (top-level) remote: host: localhost port: 9020 timeout_connect: 2.0 timeout_send: 2.0 ``` -------------------------------- ### Basic CoreLog Minimal Usage Source: https://github.com/el-peppo/corelog_min/blob/master/README.md Demonstrates how to import corelog, create a logger instance, and log messages at different levels (info, error, debug) with additional keyword arguments for context. ```python from corelog_min import corelog # Create logger log = corelog("myapp") # Logging log.info("Application started") log.error("Something went wrong", error_code=500) log.debug("Debug information", user_id=123) ``` -------------------------------- ### CoreLog Minimal Basic Python Usage Source: https://github.com/el-peppo/corelog_min/blob/master/CLAUDE.md This Python snippet demonstrates the fundamental steps to initialize the CoreLog Minimal logger for an application. It shows how to create a logger instance and how to log informational and error messages, including the ability to pass additional contextual key-value pairs. ```python from corelog import corelog log = corelog("myapp") log.info("Application started") log.error("Something went wrong", error_code=500) ``` -------------------------------- ### Run CoreLog Minimal Tests Source: https://github.com/el-peppo/corelog_min/blob/master/README.md Commands to execute both basic unit tests and integration tests for CoreLog Minimal. Note that integration tests may require a running remote logging server. ```bash python test_minimal.py ``` ```bash python test_integration.py ``` -------------------------------- ### Enable CoreLog Handlers via YAML Configuration Source: https://github.com/el-peppo/corelog_min/blob/master/README.md YAML configuration demonstrating how to enable console, file, and remote logging handlers, including specific settings for file path, maximum size, retention days, and remote server host/port details. ```yaml logger: level: DEBUG handlers: console: true file: true # Enable file logging remote: true # Enable remote logging # File handler settings file: base_path: "./logs" max_size_mb: 10 keep_days: 30 # Remote handler settings remote: host: "192.168.1.100" port: 9020 timeout_connect: 2.0 timeout_send: 2.0 ``` -------------------------------- ### Enable CoreLog Handlers via Code Override Source: https://github.com/el-peppo/corelog_min/blob/master/README.md Shows how to programmatically override CoreLog's configuration using the `config_override` parameter, enabling specific handlers like file or remote logging directly in Python code. ```python # Enable file handler log = corelog("myapp", config_override={ "logger": { "level": "DEBUG", "handlers": {"console": True, "file": True} } }) ``` ```python # Enable remote logging log = corelog("myapp", config_override={ "logger": { "handlers": {"console": True, "remote": True} }, "remote": {"host": "192.168.1.100", "port": 9020} }) ``` -------------------------------- ### CoreLog Minimal Remote Handler YAML Configuration Source: https://github.com/el-peppo/corelog_min/blob/master/CLAUDE.md This YAML snippet illustrates the correct configuration structure for the remote handler in CoreLog Minimal. It highlights the critical requirement that the `remote` section must be a top-level key, not nested under `logger`, to ensure proper parsing and functionality. ```yaml logger: handlers: remote: true remote: # <-- Top-level, NOT under logger host: 10.1.1.10 port: 9020 ``` -------------------------------- ### CoreLog Minimal Programmatic Configuration Override Source: https://github.com/el-peppo/corelog_min/blob/master/CLAUDE.md This Python snippet illustrates how to dynamically override CoreLog Minimal's configuration during logger initialization. By passing a `config_override` dictionary, developers can programmatically adjust log levels, enable or disable specific handlers, and configure handler-specific settings like remote host and port. ```python log = corelog("myapp", config_override={ "logger": { "level": "DEBUG", "handlers": {"console": True, "file": True, "remote": True} }, "remote": { "host": "10.1.1.10", "port": 9020 } }) ``` -------------------------------- ### LogRecord Dataclass API Structure Source: https://github.com/el-peppo/corelog_min/blob/master/CLAUDE.md This APIDOC entry details the structure of the `LogRecord` dataclass used by CoreLog Minimal to encapsulate log event data. It lists all fields, including timestamp, application name, log level (both name and value), message string, a context dictionary for key-value pairs, and an optional IP address. ```APIDOC LogRecord (logger.py:17-50): ts: datetime timestamp app: application name level_name: string level name level_val: numeric level value msg: message string ctx: context dictionary for key=value pairs ip: optional IP address ``` -------------------------------- ### CoreLogger Class API Definition Source: https://github.com/el-peppo/corelog_min/blob/master/CLAUDE.md This APIDOC entry describes the `CoreLogger` class, which serves as the central component of the CoreLog Minimal library. It is responsible for managing log handlers and their respective log levels, notably employing lazy initialization for handlers to optimize resource usage. ```APIDOC CoreLogger (logger.py:52-221): Description: Main logger class that manages handlers and log levels. Uses lazy initialization for handlers. ``` -------------------------------- ### BaseHandler Class API Definition Source: https://github.com/el-peppo/corelog_min/blob/master/CLAUDE.md This APIDOC entry defines the `BaseHandler` class, which acts as the abstract base class for all specific handler implementations within the CoreLog Minimal logging system. It establishes the common interface and foundational structure for concrete handlers like ConsoleHandler, FileHandler, and RemoteHandler. ```APIDOC BaseHandler (handlers/base_handler.py): Description: Abstract base class ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.