Last change
on this file since 2380 was
997,
checked in by nanardon, 12 years ago
|
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id Rev
|
File size:
811 bytes
|
Rev | Line | |
---|
[523] | 1 | #!/usr/bin/perl |
---|
| 2 | |
---|
| 3 | use strict; |
---|
| 4 | use warnings; |
---|
| 5 | use LATMOS::Accounts::Log; |
---|
| 6 | use Getopt::Long; |
---|
| 7 | use Pod::Usage; |
---|
| 8 | |
---|
| 9 | =head1 NAME |
---|
| 10 | |
---|
| 11 | la-log-test - Tools to LATMOS::Account loggin system |
---|
| 12 | |
---|
| 13 | =head1 SYNOPSIS |
---|
| 14 | |
---|
[594] | 15 | la-log-test [options] |
---|
[523] | 16 | |
---|
| 17 | =cut |
---|
| 18 | |
---|
| 19 | GetOptions( |
---|
| 20 | 'c|config=s' => \my $config, |
---|
| 21 | 'l|level=s' => \my $level, |
---|
[861] | 22 | 'mail=s' => \my $mail, |
---|
[523] | 23 | 'help' => sub { pod2usage(0) }, |
---|
| 24 | ) or pod2usage(); |
---|
| 25 | |
---|
| 26 | =head1 OPTIONS |
---|
| 27 | |
---|
| 28 | =over 4 |
---|
| 29 | |
---|
[861] | 30 | =item -c|--config configdir |
---|
[523] | 31 | |
---|
[861] | 32 | Use this configuration directory instead of the default one. |
---|
[523] | 33 | |
---|
| 34 | =item -l|--level level |
---|
| 35 | |
---|
| 36 | Set the log level |
---|
| 37 | |
---|
[861] | 38 | =item --mail email |
---|
| 39 | |
---|
| 40 | Setup log error sent to email at end of execution |
---|
| 41 | |
---|
[997] | 42 | =back |
---|
| 43 | |
---|
[523] | 44 | =cut |
---|
| 45 | |
---|
| 46 | $level ||= 'LA_INFO'; |
---|
| 47 | |
---|
[861] | 48 | if ($mail) { |
---|
| 49 | la_set_log(mail => $mail); |
---|
| 50 | } |
---|
| 51 | |
---|
[523] | 52 | my $numlevel = eval "LATMOS::Accounts::Log::$level()"; |
---|
| 53 | |
---|
| 54 | la_log($numlevel, "message from $0 ($level)"); |
---|
Note: See
TracBrowser
for help on using the repository browser.