[Jifty-commit] r5948 - in jifty/trunk: lib/Jifty/Server/Fork lib/Jifty/Server/Prefork
Jifty commits
jifty-commit at lists.jifty.org
Thu Oct 16 14:27:00 EDT 2008
Author: alexmv
Date: Thu Oct 16 14:26:59 2008
New Revision: 5948
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Server/Fork/NetServer.pm
jifty/trunk/lib/Jifty/Server/Prefork/NetServer.pm
Log:
r38214 at kohr-ah: chmrr | 2008-10-16 14:26:25 -0400
* Make Net::Server subclasses use Log4perl infrastructure
Modified: jifty/trunk/lib/Jifty/Server/Fork/NetServer.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Server/Fork/NetServer.pm (original)
+++ jifty/trunk/lib/Jifty/Server/Fork/NetServer.pm Thu Oct 16 14:26:59 2008
@@ -19,4 +19,26 @@
Jifty->setup_database_connection();
}
+=head2 log
+
+Log messages should use Jifty's L<Log::Log4perl> infrastructure, not
+STDERR.
+
+=cut
+
+sub log {
+ my $self = shift;
+ my ($level, $msg) = @_;
+ chomp $msg;
+ my @levels = (
+ $Log::Log4perl::FATAL,
+ $Log::Log4perl::WARN,
+ $Log::Log4perl::INFO,
+ $Log::Log4perl::DEBUG,
+ $Log::Log4perl::TRACE,
+ $Log::Log4perl::TRACE,
+ );
+ Log::Log4perl->get_logger(ref $self)->log($levels[$level],$msg);
+}
+
1;
Modified: jifty/trunk/lib/Jifty/Server/Prefork/NetServer.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Server/Prefork/NetServer.pm (original)
+++ jifty/trunk/lib/Jifty/Server/Prefork/NetServer.pm Thu Oct 16 14:26:59 2008
@@ -18,4 +18,26 @@
Jifty->setup_database_connection();
}
+=head2 log
+
+Log messages should use Jifty's L<Log::Log4perl> infrastructure, not
+STDERR.
+
+=cut
+
+sub log {
+ my $self = shift;
+ my ($level, $msg) = @_;
+ chomp $msg;
+ my @levels = (
+ $Log::Log4perl::FATAL,
+ $Log::Log4perl::WARN,
+ $Log::Log4perl::INFO,
+ $Log::Log4perl::DEBUG,
+ $Log::Log4perl::TRACE,
+ $Log::Log4perl::TRACE,
+ );
+ Log::Log4perl->get_logger(ref $self)->log($levels[$level],$msg);
+}
+
1;
More information about the Jifty-commit
mailing list