tweann_logger (macula_tweann v0.18.1)

View Source

Logging infrastructure for macula-tweann.

Provides structured logging with different severity levels using OTP logger. This module wraps the OTP logger to provide a consistent interface across the TWEANN library.

Usage

Debug level - for detailed diagnostic information: tweann_logger:debug("Mutation started for agent ~p", [AgentId])

Info level - for significant but normal events: tweann_logger:info("Population evaluation complete, generation ~p", [Gen])

Warning level - for unexpected but recoverable conditions: tweann_logger:warning("Agent ~p failed evaluation: ~p", [AgentId, Reason])

Error level - for errors that require attention: tweann_logger:error("Database operation failed: ~p", [Reason])

Configuration

Log level can be configured in sys.config: {kernel, [ {logger_level, info} %% debug | info | warning | error ]}

Summary

Functions

Log debug message.

Log error message.

Log info message.

Log warning message.

Functions

debug(Format, Args)

-spec debug(Format, Args) -> ok when Format :: string(), Args :: [term()].

Log debug message.

Use for detailed diagnostic information useful during development.

Example: tweann_logger:debug("Adding neuron to agent ~p", [AgentId])

error(Format, Args)

-spec error(Format, Args) -> ok when Format :: string(), Args :: [term()].

Log error message.

Use for errors requiring attention.

Example: tweann_logger:error("Database write failed: ~p", [Reason])

info(Format, Args)

-spec info(Format, Args) -> ok when Format :: string(), Args :: [term()].

Log info message.

Use for significant normal events (milestones, completions).

Example: tweann_logger:info("Generation ~p complete, best fitness: ~p", [Gen, Fitness])

warning(Format, Args)

-spec warning(Format, Args) -> ok when Format :: string(), Args :: [term()].

Log warning message.

Use for unexpected but recoverable conditions.

Example: tweann_logger:warning("Mutation failed for agent ~p: ~p", [AgentId, Reason])