[Jifty-commit] r4588 - in jifty/trunk: lib/Jifty/Plugin
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Fri Nov 30 17:35:00 EST 2007
Author: sartak
Date: Fri Nov 30 17:35:00 2007
New Revision: 4588
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Plugin/Recorder.pm
Log:
r48450 at onn: sartak | 2007-11-30 17:34:45 -0500
Make the default log path log/requests, and make the path if needed
Modified: jifty/trunk/lib/Jifty/Plugin/Recorder.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Recorder.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Recorder.pm Fri Nov 30 17:35:00 2007
@@ -6,6 +6,7 @@
use Time::HiRes 'time';
use YAML;
+use Jifty::Util;
our $VERSION = 0.01;
@@ -19,7 +20,7 @@
sub init {
my $self = shift;
my %args = (
- path => 'log',
+ path => 'log/requests',
@_,
);
@@ -31,6 +32,7 @@
$self->start(time);
$self->path($args{path});
+ Jifty::Util->make_path($args{path});
$self->handle($self->get_handle);
}
@@ -50,13 +52,14 @@
my $request = { cgi => $cgi, ENV => \%ENV, time => $delta };
my $yaml = YAML::Dump($request);
- print { $self->handle } $yaml;
+ eval { print { $self->handle } $yaml };
+ Jifty->log->error("Unable to append to request log: $@") if $@;
}
sub get_handle {
my $self = shift;
- my $name = sprintf '%s/requests-%d-%d.log',
+ my $name = sprintf '%s/%d-%d.log',
$self->path,
$self->start,
$$;
More information about the Jifty-commit
mailing list