NAME
Akamai::Open::Debug - Debugging interface for the Akamai Open API Perl clients
VERSION
version 0.03
SYNOPSIS
use Akamai::Open::Debug;
use Akamai::Open::Client;
my $log_conf = q/
log4perl.category.Akamai.Open.Debug = DEBUG, Screen
log4perl.appender.Screen = Log::Log4perl::Appender::Screen
log4perl.appender.Screen.stderr = 1
log4perl.appender.Screen.layout = Log::Log4perl::Layout::PatternLayout
log4perl.appender.Screen.layout.ConversionPattern = %p - %C - %m%n
/;
my $debug = Akamai::Open::Debug->initialize(config => $log_conf);
my $client = Akamai::Open::Client->new(debug => $debug);
Akamai::Open::Debug uses Log::Log4perl for logging purposes and thus is very flexible and easy configurable.
ABOUT
Akamai::Open::Debug provides the debugging and logging functionality for the Akamai::Open API client and uses uses MooseX::Singleton to provide a single instance based logging solution.
USAGE
If you want to configure your own logging, just initialize your Akamai::Open API client, with an Akamai::Open::Debug object. To do this, instantiate an object with your own Log::Log4perl configuration (see Log::Log4perl for example configurations):
my $debug = Akamai::Open::Debug->initialize(config => $log_conf);
The only thing you've to consider is, that the Log::Log4perl category has to be named log4perl.category.Akamai.Open.Debug, as written in the example.
After that you can pass your object to your client:
my $client = Akamai::Open::Client->new(debug => $debug);
AUTHOR
Martin Probst <internet+cpan@megamaddin.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Martin Probst.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.