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::Shiras::Report - Report Role (Interface) for Log::Shiras

SYNOPSIS

        use Modern::Perl;
        use Log::Shiras::Switchboard;
        use Log::Shiras::Report;
        use Log::Shiras::Report::CSVFile;
        my      $operator = Log::Shiras::Switchboard->get_operator(
                        name_space_bounds =>{
                                UNBLOCK =>{
                                        to_file => 'info',# for info and more urgent messages
                                },
                        },
                        reports =>{
                                to_file =>[{
                                        superclasses =>[ 'Log::Shiras::Report::CSVFile' ],
                                        add_roles_in_sequence =>[ 
                                                'Log::Shiras::Report',
                                                'Log::Shiras::Report::MetaMessage',
                                        ],# Effectivly an early class type check
                                        file => 'test.csv',
                                }],
                        }
                );
    

DESCRIPTION

This is a simple interface that ensures the report object has an 'add_line' method. It also scrubs the input to 'add_line' method to ensure the message is a hashref with the key message. Finally, it calls a method 'manage_message' if it has been composed into the larger class. For an example see Log::Shiras::Report::MetaMessage. If you wish to build your own report object it just has to have an add_line method. To use the report it is registered to the switchboard using "reports" in Log::Shiras::Switchboard For an example of a simple report see Log::Shiras::Report::Stdout For an example of a complex report see Log::Shiras::Report::CSVFile Upon registration the reports will receive their messages from "master_talk( $args_ref )" in Log::Shiras::Switchboard.

SUPPORT

TODO

AUTHOR

Jed Lund
jandrew@cpan.org

COPYRIGHT

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

The full text of the license can be found in the LICENSE file included with this module.

DEPENDENCIES