Lines Matching defs:syslog
2 # syslog.pl
4 # $Log: syslog.pl,v $
10 # call syslog() with a string priority and a list of printf() args
11 # like syslog(3)
13 # usage: require 'syslog.pl';
19 # do syslog('info','this is another test');
20 # do syslog('mail|warning','this is a better test: %d', time);
23 # do syslog('debug','this is the last test');
25 # do syslog('notice','fooprogram: this is really done');
28 # do syslog('info','problem was %m'); # %m == $! in syslog(3)
30 package syslog;
34 $host = 'localhost' unless $host; # set $syslog'host to change
40 require 'syslog.ph';
68 sub main'syslog {
75 die "syslog: expected both priority and mask" unless $mask && $priority;
83 die "syslog: invalid level/facility: $_\n";
86 die "syslog: too many levels given: $_\n" if defined($numpri);
91 die "syslog: too many facilities given: $_\n" if defined($numfac);
97 die "syslog: level must be given\n" unless defined($numpri);
116 ($whoami = 'syslog');
147 $name = "syslog'$name";
163 ($name,$aliases,$port,$proto) = getservbyname('syslog','udp');
164 $syslog = $port;
184 $that = pack($pat,$af_inet,$syslog,@bytes);