tweann_logger (macula_tweann v0.18.1)
View SourceLogging 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.
Use for detailed diagnostic information useful during development.
Example: tweann_logger:debug("Adding neuron to agent ~p", [AgentId])
Log error message.
Use for errors requiring attention.
Example: tweann_logger:error("Database write failed: ~p", [Reason])
Log info message.
Use for significant normal events (milestones, completions).
Example: tweann_logger:info("Generation ~p complete, best fitness: ~p", [Gen, Fitness])
Log warning message.
Use for unexpected but recoverable conditions.
Example: tweann_logger:warning("Mutation failed for agent ~p: ~p", [AgentId, Reason])