Debug::Easy

Debug::Easy Logo

SYNOPSIS

use Debug::Easy;

my $debug = Debug::Easy->new( 'LogLevel' => 'DEBUG', 'Color' => 1);

'LogLevel' is the maximum level to report, and ignore the rest. The method names correspond to their loglevels, when outputting a specific message. This identifies to the module what type of message [...]

The following is a list, in order of level, of the logging methods:

The parameter is either a string or a reference to an array of strings to output as multiple lines.

Each string can contain newlines, which will also be split into a separate line and formatted accordingly:

$debug->ERR(        ['Error message']);
$debug->ERROR(      ['Error message']);

$debug->WARN(       ['Warning message']);
$debug->WARNING(    ['Warning message']);

$debug->NOTICE(     ['Notice message']);
$debug->ATTENTION   ['Notice message']);

$debug->INFO(       ['Information and VERBOSE mode message']);
$debug->INFORMATION(['Information and VERBOSE mode message']);

$debug->DEBUG(      ['Level 1 Debug message']);
$debug->DEBUGMAX(   ['Level 2 (terse) Debug message']);

my @messages = (
   'First Message',
   'Second Message',
   "Third Message First Line\nThird Message Second Line",
   \%hash_reference
);

$debug->INFO([\@messages]);

DESCRIPTION

This module makes debugging Perl code much easier and even allows you to retain the debugging code without interference in production. Using an options switch, you can enable, disable or adjust the level of debugging.

Typically, debugging runs at errors only level, but you can have verbose, ordinary debugging or quite noisy (max) debugging for very difficult problems. Add the lines to your code and leave them there.

Output can be using ANSI color codes (default), but can also be turned off to be ordinary ASCII text. Output is timestamped and location logged as well.

INSTALLATION

To install this module, run the following commands:

        perl Makefile.PL
        make
        make test
 [sudo] make install

SAMPLE CODE

The "examples" directory in the tar package has two code examples on how to use this module.

SUPPORT AND DOCUMENTATION

After installing, you can find documentation for this module with the perldoc command.

perldoc Debug::Easy

You can also look for information at:

Copyright © 2013-2025 Richard Kelsch

This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at: