diff options
| author | fukachan <fukachan> | 2006-06-10 01:05:10 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2006-06-10 01:05:10 +0000 |
| commit | d42bb62b82c4ab76d4c046cbb345bdc408b4e913 (patch) | |
| tree | bcb883632a4b7a9f80c520e053695145cd668db0 /regress/tinymta/Log.pm | |
| parent | c34c9b2957bf84ba196e8ae3bc403d35acee05ad (diff) | |
| download | fml8-snap-20060610.tar.gz fml8-snap-20060610.tar.bz2 fml8-snap-20060610.zip | |
implement least function MTA for convenience, debug and simulation.snap-20060610
Diffstat (limited to 'regress/tinymta/Log.pm')
| -rw-r--r-- | regress/tinymta/Log.pm | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/regress/tinymta/Log.pm b/regress/tinymta/Log.pm new file mode 100644 index 00000000..d3d49404 --- /dev/null +++ b/regress/tinymta/Log.pm @@ -0,0 +1,36 @@ +#-*- perl -*- +# +# Copyright (C) 2006 Ken'ichi Fukamachi +# All rights reserved. This program is free software; you can +# redistribute it and/or modify it under the same terms as Perl itself. +# +# $FML$ +# + +package TinyMTA::Log; +use strict; +use Carp; + +# Descriptions: send log message by syslog(3). +# Arguments: STR($msg) +# Side Effects: none +# Return Value: OBJ +sub log +{ + my ($msg) = @_; + + use File::Basename; + my $myname = basename($0); + my $ident = "tinymta/$myname"; + my $logopt = "pid"; + my $facility = "local0"; + my $priority = "info"; + + use Sys::Syslog; + openlog($ident, $logopt, $facility); + syslog($priority, $msg); + closelog(); +} + + +1; |
