- Timestamp:
- 01/11/09 01:47:14 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/MouseX-Log-Dispatch-Config/trunk/lib/MouseX/Log/Dispatch/Config.pm
r28274 r28277 43 43 =head1 SYNOPSIS 44 44 45 pac lage MyLogger;45 package MyLogger; 46 46 use MouseX::Log::Dispatch::Config; 47 47 48 # file-based (AppConfig style) 49 has '+config' => (default => '/path/to/log.cfg'); 50 51 package HashLogger; 52 use MouseX::Log::Dispatch::Config; 53 54 # hash-based 55 has '+config' => (default => sub { 56 { 57 class => 'Log::Dispatch::Screen', 58 min_level => 'debug', 59 stderr => 1, 60 format => '[%p] %m at %F line %L%n', 61 } 62 }); 63 64 package CustomLogger; 65 use MouseX::Log::Dispatch::Config; 66 use Log::Dispatch::Configurator::YAML; 67 68 # custom configurator 69 has '+config' => (default => sub { 70 Log::Dispatch::Configurator::YAML->new('/path/to/log.yml'); 71 }); 72 73 package main; 74 75 my $log = MyLogger->new; 76 77 $log->debug('foo'); 78 $log->logger->debug('bar'); # also works 79 80 $log->info('baz'); 81 $log->error('error'); 82 48 83 =head1 DESCRIPTION 84 85 This is a role which provides a L<Log::Dispatch::Config> logger. 86 87 =head1 METHODS 88 89 =head2 log 90 91 =head2 debug 92 93 =head2 info 94 95 =head2 notice 96 97 =head2 warning 98 99 =head2 error 100 101 =head2 critical 102 103 =head2 alert 104 105 =head2 emergency 106 107 =head1 PROPERTIES 108 109 =head2 logger 110 111 Returns a L<Log::Dispatch::Config> object. 112 113 =head2 config 49 114 50 115 =head1 AUTHOR
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)