1 diff -ru longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Logger.pm longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Logger.pm
2 --- longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Logger.pm 2015-10-28 17:15:32.816515318 +0000
3 +++ longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Logger.pm 2015-10-28 18:00:50.760332026 +0000
5 my ( $self, $message ) = @_;
7 my $ts = strftime( '%m/%d %T', localtime );
8 - $self->{logger}->write(
9 - sprintf( '%s %s Longview[%i] - %s', $ts, uc($level), $$, $message ),
10 - $levels->{$level} );
11 + printf( "%s %s Longview[%i] - %s\n", $ts, uc($level), $$, $message );
12 die "$message" if $level eq 'logdie';
16 my ( $class, $level ) = @_;
19 - mkpath($LOGDIR) unless (-d $LOGDIR);
21 - = Log::LogLite->new( $LOGDIR . 'longview.log', $level )
22 - or die "Couldn't create logger object: $!";
23 - $self->{logger}->template("<message>\n");
25 return bless $self, $class;
28 diff -ru longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Util.pm longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Util.pm
29 --- longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src.orig/Linode/Longview/Util.pm 2015-10-28 17:15:32.816515318 +0000
30 +++ longview-5bcc9b60896b72de2d14f046f911477c26eb70ba-src/Linode/Longview/Util.pm 2015-10-28 19:20:30.894314658 +0000
33 chdir '/' or $logger->logdie("Can't chdir to /: $!");
34 open STDIN, '<', '/dev/null' or $logger->logdie("Can't read /dev/null: $!");
35 - open STDOUT, '>>', '/dev/null' or $logger->logdie("Can't write to /dev/null: $!");
36 open STDERR, '>>', '/dev/null' or $logger->logdie("Can't write to /dev/null: $!");
37 tie *STDERR, "Linode::Longview::STDERRLogger";
38 defined( my $pid = fork ) or $logger->logdie("Can't fork: $!");