Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added syslog support

  • Loading branch information...
commit f2fcbde263e63e753af0a0e0eb6845ee8f27e8a0 1 parent 0986a80
@mxey mxey authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 happyman
View
10 happyman
@@ -22,15 +22,16 @@ use AnyEvent::IRC::Client;
use AnyEvent::Socket;
use Config::Tiny;
use IO::Handle;
+use Sys::Syslog qw(:standard);
sub log_info {
my($msg) = @_;
- say $msg;
+ syslog('info', $msg);
}
sub log_warning {
my($msg) = @_;
- say $msg;
+ syslog('warning', $msg);
}
my $profile;
@@ -57,6 +58,11 @@ foreach (qw(server channel nick user ircname listen_addr listen_port)) {
}
}
+openlog('happyman' . ($profile ne 'default' ? "-$profile" : ''),
+ 'ndelay,pid',
+ 'daemon',
+);
+
my $irc = new AnyEvent::IRC::Client;
sub announce {
Please sign in to comment.
Something went wrong with that request. Please try again.