The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Log::Smart - Messages for smart logging to the file

VERSION

version 0.009

SYNOPSIS

    use Log::Smart -timestamp;
    
    LOG("write a message");
    DUMP("dump the data structures", $arg);
    YAML("dump the data structures back into yaml", $arg)

DESCRIPTION

Log::Smart provides logging methods that is easy to use.

This module automatically creates and opens the file for logging. It is created to location of the file that used this module. And name of the file is the namespace + .log with using this module.

It exports a function that you can put just about anywhere in your Perl code to make it logging.

To change the location or filename, you can use the options. Please refer to OPTIONS for more information on.

    package Example;

    use Log::Smart;
    #file name "Example.log"


    package Example;
    
    use Log::Smart -name => 'mydebug.mylog';
    #file name "mydebug.mylog"

WARNING: This module automatically determines the output location(need write permission) and the filename when you don't use some options. You should carefully use it, otherwise the file of same name is overwrited.

BACKWARD INCOMPATIBILITY

Current version of Log::Smart was once called Debug::Smart. When I released this module naming it to Debug::Smart was wrong. Debug::Smart was unmatched this module functions. Thanks for nadim khemir of review.

EXPORT

LOG

To write variable to the file.

DUMP

To write the variable structures to the file with Data::Dumper::Dumper.

YAML

To write the variable structures to the file with YAML::Dump.

CLOSE

To close file handle if you want expressly.

OPTIONS

    use Log::Smart -path => '/path/to/';

-path option specify output location of the log file.

    use Log::Smart -name => 'filename';

-filename option specify the filename.

    use Log::Smart -timestamp;

-timestamp option add timestamp to the head of logging message.

    use Log::Smart -append

-append option is append mode. Writing at end-of-file. Default is write mode. It will be overwritten.

AUTHOR

Kazuhiro Shibuya, <k42uh1r0 at gmail.com>

BUGS

Please report any bugs or feature requests to bug-debug-simple@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

COPYRIGHT & LICENSE

Copyright 2007-2008 Kazuhiro Shibuya, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.