summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-01-20 03:36:00 +0000
committerfukachan <fukachan>2001-01-20 03:36:00 +0000
commitfbde0349291393b8cd29bfc1fe536ab9f435201d (patch)
treedc403bb871205608cc79892d998ab315e3ec2c05
parenta1c5b8564b06417ab12cf653df77fc3c53b32646 (diff)
downloadfml8-fbde0349291393b8cd29bfc1fe536ab9f435201d.tar.gz
fml8-fbde0349291393b8cd29bfc1fe536ab9f435201d.tar.bz2
fml8-fbde0349291393b8cd29bfc1fe536ab9f435201d.zip
s/logfile/log_file/
-rw-r--r--fml/etc/config.cf2
-rw-r--r--fml/etc/default_config.cf2
-rw-r--r--fml/lib/FML/Config.pm1
-rw-r--r--fml/lib/FML/Date.pm14
-rw-r--r--fml/lib/FML/Log.pm14
5 files changed, 17 insertions, 16 deletions
diff --git a/fml/etc/config.cf b/fml/etc/config.cf
index afde2bd4..deb29bcc 100644
--- a/fml/etc/config.cf
+++ b/fml/etc/config.cf
@@ -17,7 +17,7 @@ lock_type = flock
=head2 log
-logfile = $ml_home_dir/log
+log_file = $ml_home_dir/log
=head2 アクセス制御
diff --git a/fml/etc/default_config.cf b/fml/etc/default_config.cf
index 01769ee2..681ce281 100644
--- a/fml/etc/default_config.cf
+++ b/fml/etc/default_config.cf
@@ -2,7 +2,7 @@
### basic logging
###
# logfile
-logfile = /tmp/log
+log_file = /tmp/log
###
diff --git a/fml/lib/FML/Config.pm b/fml/lib/FML/Config.pm
index ac814dc3..024697c3 100644
--- a/fml/lib/FML/Config.pm
+++ b/fml/lib/FML/Config.pm
@@ -16,6 +16,7 @@ sub new
{
my ($self) = @_;
+ unless (defined %_fml_config) { %_fml_config = ();}
my $me = \%_fml_config;
return bless $me, $self;
}
diff --git a/fml/lib/FML/Date.pm b/fml/lib/FML/Date.pm
index 028d02fe..53b23764 100644
--- a/fml/lib/FML/Date.pm
+++ b/fml/lib/FML/Date.pm
@@ -19,8 +19,8 @@ FML::Date - utilities for date and time
$date = new FML::Date time;
# get the date in $style format
- $date->{ logfile_style }
- $date->logfile_style
+ $date->{ log_file_style }
+ $date->log_file_style
=head1 DESCRIPTION
@@ -28,7 +28,7 @@ The style you use follows:
style example
----------------------------------------------
- logfile_style 01/01/07 21:06:19
+ log_file_style 01/01/07 21:06:19
mail_header_style Sun, 7 Jan 2001 21:06:19 +0900
YYYYMMDD 20010107
current_time 200101072106
@@ -39,7 +39,7 @@ The style you use follows:
You can also method like $date->$style() style.
-=item logfile_style()
+=item log_file_style()
=item mail_header_style()
@@ -82,7 +82,7 @@ sub _date
$TimeZone ||= '+0900';
my ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime($time))[0..6];
- $date->{'logfile_style'} =
+ $date->{'log_file_style'} =
sprintf("%02d/%02d/%02d %02d:%02d:%02d",
($year % 100), $mon + 1, $mday, $hour, $min, $sec);
@@ -106,11 +106,11 @@ sub _date
}
-sub logfile_style
+sub log_file_style
{
my ($self, $time) = @_;
my $p = _date($time || time);
- $p->{'logfile_style'};
+ $p->{'log_file_style'};
}
diff --git a/fml/lib/FML/Log.pm b/fml/lib/FML/Log.pm
index b6e805a2..8da3c616 100644
--- a/fml/lib/FML/Log.pm
+++ b/fml/lib/FML/Log.pm
@@ -19,7 +19,7 @@ use FML::Config;
use FML::Date;
-# usage: &Log( message, { logfile => $logfile } );
+# usage: &Log( message, { log_file => $log_file } );
# return: none
#
sub Log
@@ -28,7 +28,7 @@ sub Log
my $config = new FML::Config;
# parse arguments
- my $logfile = $args->{ logfile };
+ my $log_file = $args->{ log_file };
my $facility = $args->{ facility };
my $level = $args->{ level };
@@ -41,12 +41,12 @@ sub Log
# open the $file by using FileHandle.pm
use FileHandle;
- # When the second argument is not defined, use the default logfile.
- my $file = $logfile || $config->{ logfile } || '/dev/stderr';
+ # When the second argument is not defined, use the default log_file.
+ my $file = $log_file || $config->{ log_file } || '/dev/stderr';
my $fh = new FileHandle ">> $file";
if (defined $fh) {
- print $fh $rdate->{'logfile_style'}, " ", $mesg, "\n";
+ print $fh $rdate->{'log_file_style'}, " ", $mesg, "\n";
}
else {
croak "Error: cannot open $file\n";
@@ -71,7 +71,7 @@ or specify arguments in the hash reference
use FML::Log qw(Log);
&Log( $log_message , {
- logfile => $logfile,
+ log_file => $log_file,
facility => $facility,
level => $level,
});
@@ -80,7 +80,7 @@ or specify arguments in the hash reference
=head1 DESCRIPTION
FML::Log.pm contains several interfaces for several files,
-for example, logfiles, syslog() (not yet implemented).
+for example, log files, syslog() (not yet implemented).
=item Log( $message )