diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 512ffec..9c08ce0 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev ================================================================== + * Added API function dbug() * Added a debug mode. * Old logs can now expire if set to do so in config. * Added API function alog() diff --git a/src/API/Log.pm b/src/API/Log.pm index d0c5769..22cdeda 100644 --- a/src/API/Log.pm +++ b/src/API/Log.pm @@ -42,7 +42,12 @@ sub println # Print only if in debug mode. sub dbug { + my ($out) = @_; + if ($Auto::DEBUG) { + # We're in debug mode; print it out. + println $out; + } } # Log to file.