[Jifty-commit] r5990 - in jifty/trunk: . lib/Jifty lib/Jifty/Plugin lib/Jifty/Plugin/Chart lib/Jifty/Plugin/Chart/Renderer lib/Jifty/Plugin/Debug lib/Jifty/Plugin/OpenID lib/Jifty/Plugin/REST lib/Jifty/Plugin/Recorder/Command lib/Jifty/Script lib/Jifty/Subs lib/Jifty/Test/WWW lib/Jifty/View/Declare lib/Jifty/View/Mason lib/Jifty/View/Static lib/Jifty/Web/Form
Jifty commits
jifty-commit at lists.jifty.org
Fri Nov 14 17:34:59 EST 2008
Author: alexmv
Date: Fri Nov 14 17:34:58 2008
New Revision: 5990
Modified:
jifty/trunk/ (props changed)
jifty/trunk/lib/Jifty/Action.pm
jifty/trunk/lib/Jifty/Continuation.pm
jifty/trunk/lib/Jifty/Handler.pm
jifty/trunk/lib/Jifty/LetMe.pm
jifty/trunk/lib/Jifty/Object.pm
jifty/trunk/lib/Jifty/Plugin.pm
jifty/trunk/lib/Jifty/Plugin/Chart/Renderer.pm
jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/Google.pm
jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm
jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm
jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm
jifty/trunk/lib/Jifty/Plugin/Debug/Dispatcher.pm
jifty/trunk/lib/Jifty/Plugin/Halo.pm
jifty/trunk/lib/Jifty/Plugin/I18N.pm
jifty/trunk/lib/Jifty/Plugin/LeakTracker.pm
jifty/trunk/lib/Jifty/Plugin/Monitoring.pm
jifty/trunk/lib/Jifty/Plugin/OpenID/Action/VerifyOpenID.pm
jifty/trunk/lib/Jifty/Plugin/OpenID/Dispatcher.pm
jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm
jifty/trunk/lib/Jifty/Plugin/Recorder.pm
jifty/trunk/lib/Jifty/Plugin/Recorder/Command/Playback.pm
jifty/trunk/lib/Jifty/Plugin/SQLQueries.pm
jifty/trunk/lib/Jifty/Record.pm
jifty/trunk/lib/Jifty/Script.pm
jifty/trunk/lib/Jifty/Script/Po.pm
jifty/trunk/lib/Jifty/Subs.pm
jifty/trunk/lib/Jifty/Subs/Render.pm
jifty/trunk/lib/Jifty/Test/WWW/Selenium.pm
jifty/trunk/lib/Jifty/View.pm
jifty/trunk/lib/Jifty/View/Declare/Handler.pm
jifty/trunk/lib/Jifty/View/Mason/Handler.pm
jifty/trunk/lib/Jifty/View/Static/Handler.pm
jifty/trunk/lib/Jifty/Web.pm
jifty/trunk/lib/Jifty/Web/Form/Element.pm
Log:
r39135 at kohr-ah: chmrr | 2008-11-14 17:34:32 -0500
* Move log messages, whenever possible, to $self->log rather than Jifty->log
Modified: jifty/trunk/lib/Jifty/Action.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Action.pm (original)
+++ jifty/trunk/lib/Jifty/Action.pm Fri Nov 14 17:34:58 2008
@@ -482,7 +482,7 @@
# The field name is not known by this action
unless ($field_info) {
local $Log::Log4perl::caller_depth += 2;
- Jifty->log->warn("$field isn't a valid field for $self");
+ $self->log->warn("$field isn't a valid field for $self");
return;
}
# It is in fact a form field for this action
@@ -1109,10 +1109,10 @@
if ($v->{'collection'}->count) {
unless ($v->{'collection'}->first->can($disp)) {
- Jifty->log->error("Invalid 'display_from' of $disp on $field");
+ $self->log->error("Invalid 'display_from' of $disp on $field");
}
unless ($v->{'collection'}->first->can($val)) {
- Jifty->log->error("Invalid 'value_from' of $val on $field");
+ $self->log->error("Invalid 'value_from' of $val on $field");
}
}
Modified: jifty/trunk/lib/Jifty/Continuation.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Continuation.pm (original)
+++ jifty/trunk/lib/Jifty/Continuation.pm Fri Nov 14 17:34:58 2008
@@ -56,7 +56,7 @@
use Storable 'dclone';
-use base qw/Class::Accessor::Fast/;
+use base qw/Class::Accessor::Fast Jifty::Object/;
__PACKAGE__->mk_accessors(qw(id parent
request response code
@@ -173,7 +173,7 @@
sub call {
my $self = shift;
- Jifty->log->debug("Redirect to @{[$self->request->path]} via continuation");
+ $self->log->debug("Redirect to @{[$self->request->path]} via continuation");
if (Jifty->web->request->argument('_webservice_redirect')) {
# for continuation - perform internal redirect under webservices.
Jifty->web->webservices_redirect($self->request->path);
@@ -183,7 +183,7 @@
# If we needed to fix up the path (it contains invalid
# characters) then warn, because this may cause infinite
# redirects
- Jifty->log->warn("Redirect to '@{[$self->request->path]}' contains unsafe characters")
+ $self->log->warn("Redirect to '@{[$self->request->path]}' contains unsafe characters")
if $self->request->path =~ m{[^A-Za-z0-9\-_.!~*'()/?&;+]};
# Clone our request
Modified: jifty/trunk/lib/Jifty/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Handler.pm (original)
+++ jifty/trunk/lib/Jifty/Handler.pm Fri Nov 14 17:34:58 2008
@@ -24,7 +24,7 @@
=cut
-use base qw/Class::Accessor::Fast/;
+use base qw/Class::Accessor::Fast Jifty::Object/;
use Jifty::View::Declare::Handler ();
use Class::Trigger;
@@ -236,7 +236,7 @@
for ( Jifty->plugins ) {
$_->new_request;
}
- Jifty->log->info( $self->apache->method . " request for " . Jifty->web->request->path );
+ $self->log->info( $self->apache->method . " request for " . Jifty->web->request->path );
Jifty->web->setup_session;
Jifty::I18N->get_language_handle;
Modified: jifty/trunk/lib/Jifty/LetMe.pm
==============================================================================
--- jifty/trunk/lib/Jifty/LetMe.pm (original)
+++ jifty/trunk/lib/Jifty/LetMe.pm Fri Nov 14 17:34:58 2008
@@ -272,22 +272,22 @@
# email must exist
unless ($self->_user_from_email($self->email)) {
- Jifty->log->debug("Token validation failed - Invalid user");
+ $self->log->debug("Token validation failed - Invalid user");
return undef;
}
unless ($self->path) {
- Jifty->log->debug("Token validation failed - Invalid path");
+ $self->log->debug("Token validation failed - Invalid path");
return undef;
}
unless ($self->checksum_provided) {
- Jifty->log->debug("Token validation failed - Checksum not provided");
+ $self->log->debug("Token validation failed - Checksum not provided");
return undef;
}
unless ($self->_correct_checksum_provided) {
- Jifty->log->debug("Token validation failed - Checksum not correct");
+ $self->log->debug("Token validation failed - Checksum not correct");
return undef;
}
@@ -304,7 +304,7 @@
sub _correct_checksum_provided {
my $self = shift;
- Jifty->log->debug("LetMe checksum: ".$self->checksum_provided . " vs ". $self->generate_checksum );
+ $self->log->debug("LetMe checksum: ".$self->checksum_provided . " vs ". $self->generate_checksum );
return undef
unless ( $self->checksum_provided eq $self->generate_checksum )
or
Modified: jifty/trunk/lib/Jifty/Object.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Object.pm (original)
+++ jifty/trunk/lib/Jifty/Object.pm Fri Nov 14 17:34:58 2008
@@ -118,7 +118,7 @@
sub log {
my $self = shift;
- return Log::Log4perl->get_logger(ref $self);
+ return Log::Log4perl->get_logger(ref($self) || $self);
}
Modified: jifty/trunk/lib/Jifty/Plugin.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin.pm Fri Nov 14 17:34:58 2008
@@ -3,7 +3,7 @@
package Jifty::Plugin;
use File::ShareDir 'module_dir';
-use base 'Class::Accessor::Fast';
+use base qw/Class::Accessor::Fast Jifty::Object/;
__PACKAGE__->mk_accessors('_pre_init');
=head1 NAME
Modified: jifty/trunk/lib/Jifty/Plugin/Chart/Renderer.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Chart/Renderer.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Chart/Renderer.pm Fri Nov 14 17:34:58 2008
@@ -3,6 +3,8 @@
package Jifty::Plugin::Chart::Renderer;
+use base qw/Jifty::Object/;
+
=head1 NAME
Jifty::Plugin::Chart::Renderer - Base class for chart rendering classes
Modified: jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/Google.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/Google.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/Google.pm Fri Nov 14 17:34:58 2008
@@ -66,7 +66,7 @@
# Not a supported type
if ( not defined $type ) {
- Jifty->log->warn("Unsupported chart type: $args{'type'}!");
+ $self->log->warn("Unsupported chart type: $args{'type'}!");
return;
}
Modified: jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/PlotKit.pm Fri Nov 14 17:34:58 2008
@@ -61,7 +61,7 @@
# Bad stuff, not a supported type
if ( not defined $args{type} ) {
- Jifty->log->warn("Unsupported chart type: $orig_type!");
+ $self->log->warn("Unsupported chart type: $orig_type!");
return;
}
Modified: jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Chart/Renderer/XMLSWF.pm Fri Nov 14 17:34:58 2008
@@ -69,7 +69,7 @@
if ($args{type} eq 'composite') {
for (@{ $args{types} }) {
if (!$types{$_}) {
- Jifty->log->warn("Unsupported chart type: $_!");
+ $self->log->warn("Unsupported chart type: $_!");
return;
}
$_ = $types{$_};
@@ -77,7 +77,7 @@
}
else {
$args{type} = $types{ $args{type} } or do {
- Jifty->log->warn("Unsupported chart type: $args{type}!");
+ $self->log->warn("Unsupported chart type: $args{type}!");
return;
};
}
Modified: jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/CompressedCSSandJS.pm Fri Nov 14 17:34:58 2008
@@ -137,7 +137,7 @@
return if Jifty::CAS->key('ccjs', 'css-all') && !Jifty->config->framework('DevelMode');
- Jifty->log->debug("Generating CSS...");
+ $self->log->debug("Generating CSS...");
my @roots = map { Jifty::Util->absolute_path( $_ ) }
Jifty->handler->view('Jifty::View::Static::Handler')->roots;
@@ -163,7 +163,7 @@
my $self = shift;
return if Jifty::CAS->key('ccjs', 'js-all') && !Jifty->config->framework('DevelMode');
- Jifty->log->debug("Generating JS...");
+ $self->log->debug("Generating JS...");
# for the file cascading logic
my $static_handler = Jifty->handler->view('Jifty::View::Static::Handler');
@@ -188,7 +188,7 @@
}
if ($self->jsmin) {
eval { $self->minify_js(\$js) };
- Jifty->log->error("Unable to run jsmin: $@") if $@;
+ $self->log->error("Unable to run jsmin: $@") if $@;
}
Jifty::CAS->publish( 'ccjs', 'js-all', $js,
@@ -206,7 +206,7 @@
my $input = shift;
my $output;
- Jifty->log->debug("Minifying JS...");
+ $self->log->debug("Minifying JS...");
# We need to reopen stdout temporarily, because in FCGI
# environment, stdout is tied to FCGI::Stream, and the child
@@ -231,7 +231,7 @@
my $key = Jifty::CAS->key('ccjs', $name);
if ( Jifty->handler->cgi->http('If-Modified-Since') and $incoming_key eq $key ) {
- Jifty->log->debug("Returning 304 for cached $name");
+ $self->log->debug("Returning 304 for cached $name");
Jifty->handler->apache->header_out( Status => 304 );
return;
}
@@ -245,11 +245,11 @@
Jifty::View::Static::Handler->send_http_header($compression, length($obj->content));
if ( $compression ) {
- Jifty->log->debug("Sending gzipped squished $name");
+ $self->log->debug("Sending gzipped squished $name");
binmode STDOUT;
print $obj->content_deflated;
} else {
- Jifty->log->debug("Sending squished $name");
+ $self->log->debug("Sending squished $name");
print $obj->content;
}
}
Modified: jifty/trunk/lib/Jifty/Plugin/Debug/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Debug/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Debug/Dispatcher.pm Fri Nov 14 17:34:58 2008
@@ -21,7 +21,7 @@
=cut
on qr'(.*)' => run {
- Jifty->log->info("[$$] $1 ".(Jifty->web->current_user->id ? Jifty->web->current_user->username : ''));
+ $Dispatcher->log->info("[$$] $1 ".(Jifty->web->current_user->id ? Jifty->web->current_user->username : ''));
};
1;
Modified: jifty/trunk/lib/Jifty/Plugin/Halo.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Halo.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Halo.pm Fri Nov 14 17:34:58 2008
@@ -32,7 +32,7 @@
# 0.28 added around_template instrumentation
eval { Template::Declare->VERSION('0.28'); 1 }
or do {
- Jifty->log->debug("Template::Declare 0.28 required for TD halos.");
+ $self->log->debug("Template::Declare 0.28 required for TD halos.");
return;
};
Modified: jifty/trunk/lib/Jifty/Plugin/I18N.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/I18N.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/I18N.pm Fri Nov 14 17:34:58 2008
@@ -81,10 +81,10 @@
} @$allowed_lang;
unless ( $current_lang =~ /^$allowed_regex/) {
- Jifty->log->error("user is requesting $current_lang which is not allowed");
+ $self->log->error("user is requesting $current_lang which is not allowed");
my $headers = Jifty->handler->apache->headers_in;
use Data::Dumper;
- Jifty->log->error(Dumper($headers));
+ $self->log->error(Dumper($headers));
}
}
@@ -112,7 +112,7 @@
}
else {
- Jifty->log->error("Can't find dictionary file $current_lang.json: $!");
+ $self->log->error("Can't find dictionary file $current_lang.json: $!");
}
}
Modified: jifty/trunk/lib/Jifty/Plugin/LeakTracker.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/LeakTracker.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/LeakTracker.pm Fri Nov 14 17:34:58 2008
@@ -98,7 +98,7 @@
last;
}
};
- Jifty->log->warn($@) if $@;
+ $self->log->warn($@) if $@;
push @requests, {
id => 1 + @requests,
Modified: jifty/trunk/lib/Jifty/Plugin/Monitoring.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Monitoring.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Monitoring.pm Fri Nov 14 17:34:58 2008
@@ -261,7 +261,7 @@
my $unit = $self->monitors->{$name}->{unit};
my $now = Jifty::DateTime->now->truncate( to => $unit );
- Jifty->log->warn("No last run time for monitor $name; inserting $now");
+ $self->log->warn("No last run time for monitor $name; inserting $now");
$last->set_last_run($now);
return $last;
}
@@ -308,14 +308,14 @@
my %monitor = %{$self->monitors->{$name}};
my $next = $last->last_run->add( $monitor{unit}."s" => $monitor{count} );
next unless $now >= $next;
- Jifty->log->warn("Cron not being run often enough: we skipped a '$name'!")
+ $self->log->warn("Cron not being run often enough: we skipped a '$name'!")
if $now >= $next->add( $monitor{unit}."s" => $monitor{count} );
$self->current_monitor(\%monitor);
eval {
$monitor{sub}->($self);
};
if (my $error = $@) {
- Jifty->log->warn("Error running monitor $name: $error");
+ $self->log->warn("Error running monitor $name: $error");
} else {
$last->set_last_run($now);
}
@@ -336,15 +336,15 @@
if (-e $self->lockfile) {
my ($pid) = do {local @ARGV = ($self->lockfile); <>};
if (kill 0, $pid) {
- Jifty->log->warn("Monitor PID $pid still running");
+ $self->log->warn("Monitor PID $pid still running");
return 0;
} else {
- Jifty->log->warn("Stale PID file @{[$self->lockfile]}; removing");
+ $self->log->warn("Stale PID file @{[$self->lockfile]}; removing");
unlink($self->lockfile);
}
}
unless (open PID, ">", $self->lockfile) {
- Jifty->log->warn("Can't open lockfile @{[$self->lockfile]}: $!");
+ $self->log->warn("Can't open lockfile @{[$self->lockfile]}: $!");
return 0;
}
print PID $$;
Modified: jifty/trunk/lib/Jifty/Plugin/OpenID/Action/VerifyOpenID.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OpenID/Action/VerifyOpenID.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OpenID/Action/VerifyOpenID.pm Fri Nov 14 17:34:58 2008
@@ -58,7 +58,7 @@
return;
}
- Jifty->log( "identified as: " . $ident->url );
+ $self->log->debug( "identified as: " . $ident->url );
$self->result->content( openid => $ident->url );
return 1;
Modified: jifty/trunk/lib/Jifty/Plugin/OpenID/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/OpenID/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/OpenID/Dispatcher.pm Fri Nov 14 17:34:58 2008
@@ -59,7 +59,7 @@
if ( defined $result and $result->success ) {
my $openid = $result->content('openid');
my $user = Jifty->app_class('CurrentUser')->new( openid => $openid );
- Jifty->log->info("User Class: $user. OpenID: $openid");
+ $Dispatcher->log->info("User Class: $user. OpenID: $openid");
if ( $user->id ) {
# Set up our login message
@@ -79,7 +79,7 @@
else {
# User needs to create account still
Jifty->web->session->set( openid => $openid );
- Jifty->log->info("got openid: $openid");
+ $Dispatcher->log->info("got openid: $openid");
my $nick = get('openid.sreg.nickname');
if ( $nick ) {
redirect( Jifty::Web::Form::Clickable->new( url => '/openid/create', parameters => { nickname => $nick, openid => $openid } ));
Modified: jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/REST/Dispatcher.pm Fri Nov 14 17:34:58 2008
@@ -885,7 +885,7 @@
eval { $action->run };
if ($@) {
- Jifty->log->warn($@);
+ $Dispatcher->log->warn($@);
abort(500);
}
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 14 17:34:58 2008
@@ -77,7 +77,7 @@
$self->logged_request(1);
};
- Jifty->log->error("Unable to append to request log: $@") if $@;
+ $self->log->error("Unable to append to request log: $@") if $@;
}
=head2 before_cleanup
@@ -115,7 +115,7 @@
return;
}
- Jifty->log->error("Unable to find myself, pid $$, in Proc::ProcessTable.");
+ $self->log->error("Unable to find myself, pid $$, in Proc::ProcessTable.");
}
};
}
@@ -139,12 +139,12 @@
$$;
open my $loghandle, '>', $name or do {
- Jifty->log->error("Unable to open $name for writing: $!");
+ $self->log->error("Unable to open $name for writing: $!");
return;
};
$loghandle->autoflush(1);
- Jifty->log->info("Logging all HTTP requests to $name.");
+ $self->log->info("Logging all HTTP requests to $name.");
$self->loghandle($loghandle);
}
Modified: jifty/trunk/lib/Jifty/Plugin/Recorder/Command/Playback.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/Recorder/Command/Playback.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/Recorder/Command/Playback.pm Fri Nov 14 17:34:58 2008
@@ -124,7 +124,7 @@
# print STDOUT
local *STDOUT;
- Jifty->log->info("Logging request's output to $filename.");
+ $self->log->info("Logging request's output to $filename.");
open *STDOUT, '>', $filename
or die "Unable to open $filename for writing: $!";
@@ -161,7 +161,7 @@
$request->{time} = $self->{max}
if defined($self->{max}) && $request->{time} > $self->{max};
- Jifty->log->info("Next request in $request->{time} seconds.");
+ $self->log->info("Next request in $request->{time} seconds.");
sleep $request->{time};
$current_time += $request->{time};
Modified: jifty/trunk/lib/Jifty/Plugin/SQLQueries.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Plugin/SQLQueries.pm (original)
+++ jifty/trunk/lib/Jifty/Plugin/SQLQueries.pm Fri Nov 14 17:34:58 2008
@@ -77,7 +77,7 @@
Jifty->handle->log_sql_statements(1);
Jifty->handle->log_sql_hook(SQLQueryPlugin => sub {
my ($time, $statement, $bindings, $duration) = @_;
- Jifty->log->debug(sprintf 'Query (%.3fs): "%s", with bindings: %s',
+ __PACKAGE__->log->debug(sprintf 'Query (%.3fs): "%s", with bindings: %s',
$duration,
$statement,
join ', ',
Modified: jifty/trunk/lib/Jifty/Record.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Record.pm (original)
+++ jifty/trunk/lib/Jifty/Record.pm Fri Nov 14 17:34:58 2008
@@ -563,7 +563,7 @@
sub delete {
my $self = shift;
unless ( $self->check_delete_rights(@_) ) {
- Jifty->log->logcluck("Permission denied");
+ $self->log->logcluck("Permission denied");
return ( 0, _('Permission denied') );
}
$self->SUPER::delete(@_);
Modified: jifty/trunk/lib/Jifty/Script.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Script.pm (original)
+++ jifty/trunk/lib/Jifty/Script.pm Fri Nov 14 17:34:58 2008
@@ -1,6 +1,6 @@
package Jifty::Script;
use App::CLI;
-use base qw/App::CLI App::CLI::Command/;
+use base qw/App::CLI App::CLI::Command Jifty::Object/;
use Jifty::Everything;
Jifty::Everything->plugin_commands;
Modified: jifty/trunk/lib/Jifty/Script/Po.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Script/Po.pm (original)
+++ jifty/trunk/lib/Jifty/Script/Po.pm Fri Nov 14 17:34:58 2008
@@ -134,9 +134,9 @@
);
unless ( @catalogs ) {
- Jifty->log->error("You have no existing message catalogs.");
- Jifty->log->error("Run `jifty po --language <lang>` to create a new one.");
- Jifty->log->error("Read `jifty po --help` to get more info.");
+ $self->log->error("You have no existing message catalogs.");
+ $self->log->error("Run `jifty po --language <lang>` to create a new one.");
+ $self->log->error("Read `jifty po --help` to get more info.");
return
}
Modified: jifty/trunk/lib/Jifty/Subs.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Subs.pm (original)
+++ jifty/trunk/lib/Jifty/Subs.pm Fri Nov 14 17:34:58 2008
@@ -3,6 +3,7 @@
package Jifty::Subs;
+use base qw/Jifty::Object/;
use constant new => __PACKAGE__;
@@ -87,7 +88,7 @@
my $class = shift;
my $args = {@_};
unless (Jifty->config->framework('PubSub')->{'Enable'}) {
- Jifty->log->error("PubSub disabled, but $class->add called");
+ $class->log->error("PubSub disabled, but $class->add called");
return undef;
}
@@ -149,7 +150,7 @@
my ($class, $channel_id) = @_;
unless (Jifty->config->framework('PubSub')->{'Enable'}) {
- Jifty->log->error("PubSub disabled, but $class->cancel called");
+ $class->log->error("PubSub disabled, but $class->cancel called");
return undef;
}
@@ -189,10 +190,10 @@
sub list {
- my $self = shift;
+ my $class = shift;
unless (Jifty->config->framework('PubSub')->{'Enable'}) {
- Jifty->log->error("PubSub disabled, but $self->add called");
+ $class->log->error("PubSub disabled, but $class->add called");
return undef;
}
@@ -211,7 +212,7 @@
=cut
sub update_on {
- my $self = shift;
+ my $class = shift;
my $region = Jifty->web->current_region;
unless ($region) {
@@ -223,7 +224,7 @@
delete $args{region};
delete $args{event};
- $self->add(
+ $class->add(
queries => [ \%args ],
arguments => \%args,
mode => 'Replace',
Modified: jifty/trunk/lib/Jifty/Subs/Render.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Subs/Render.pm (original)
+++ jifty/trunk/lib/Jifty/Subs/Render.pm Fri Nov 14 17:34:58 2008
@@ -2,6 +2,8 @@
use strict;
use warnings;
+use base qw/Jifty::Object/;
+
=head1 NAME
Jifty::Subs::Render - Helper for subscriptions rendering
@@ -47,7 +49,7 @@
$event_class =~ s/-.*//;
unless ( UNIVERSAL::can( $event_class => 'new' ) ) {
- Jifty->log->error("Receiving unknown event $event_class from the Bus");
+ $class->log->error("Receiving unknown event $event_class from the Bus");
$event_class = Jifty->app_class("Event");
}
@@ -59,10 +61,10 @@
for my $render_info (values %{$render->{$channel}}) {
if ($render_info->{coalesce} and $render_info->{mode} eq "Replace") {
my $hash = Digest::MD5::md5_hex( YAML::Dump([$render_info->{region}, $render_info->{render_with}] ) );
- Jifty->log->debug("Coalesced duplicate region @{[$render_info->{region}]} with @{[$render_info->{render_with}]} from $channel event $msg") if exists $coalesce{$hash};
+ $class->log->debug("Coalesced duplicate region @{[$render_info->{region}]} with @{[$render_info->{render_with}]} from $channel event $msg") if exists $coalesce{$hash};
$coalesce{$hash} = [ $timestamp, $event_class, $msg, $render_info ] unless $coalesce{$hash} and $coalesce{$hash}[0] > $timestamp;
} else {
- Jifty->log->debug("Rendering $channel event $msg in @{[$render_info->{region}]} with @{[$render_info->{render_with}]}");
+ $class->log->debug("Rendering $channel event $msg in @{[$render_info->{region}]} with @{[$render_info->{render_with}]}");
render_single( $event_class, $msg, $render_info, $callback );
$sent++;
}
@@ -72,7 +74,7 @@
for my $c (values %coalesce) {
my (undef, $event_class, $msg, $render_info) = @{$c};
- Jifty->log->debug("Rendering @{[$render_info->{region}]} with @{[$render_info->{render_with}]} for $event_class");
+ $class->log->debug("Rendering @{[$render_info->{region}]} with @{[$render_info->{render_with}]} for $event_class");
render_single( $event_class, $msg, $render_info, $callback );
$sent++;
}
Modified: jifty/trunk/lib/Jifty/Test/WWW/Selenium.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test/WWW/Selenium.pm (original)
+++ jifty/trunk/lib/Jifty/Test/WWW/Selenium.pm Fri Nov 14 17:34:58 2008
@@ -89,7 +89,7 @@
sub _get_default_browser {
my $class = shift;
- return '*firefox';
+ return '*firefox /usr/lib/mozilla-firefox/firefox';
}
my @cleanup;
Modified: jifty/trunk/lib/Jifty/View.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View.pm (original)
+++ jifty/trunk/lib/Jifty/View.pm Fri Nov 14 17:34:58 2008
@@ -2,6 +2,8 @@
use strict;
use warnings;
+use base qw/Jifty::Object/;
+
=head1 NAME
Jifty::View - Base class for view modules
Modified: jifty/trunk/lib/Jifty/View/Declare/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Declare/Handler.pm (original)
+++ jifty/trunk/lib/Jifty/View/Declare/Handler.pm Fri Nov 14 17:34:58 2008
@@ -3,7 +3,7 @@
use warnings;
use strict;
-use base qw/Jifty::Object Class::Accessor::Fast/;
+use base qw/Jifty::View Class::Accessor::Fast/;
use Template::Declare;
__PACKAGE__->mk_accessors(qw/root_class/);
@@ -49,7 +49,7 @@
unless (defined $comp_root and $comp_root->isa('Template::Declare') ){
next;
}
- Jifty->log->debug( "Plugin @{[ref($plugin)]}::View added as a Template::Declare root");
+ $plugin->log->debug( "Plugin @{[ref($plugin)]}::View added as a Template::Declare root");
push @{ $config{roots} }, $comp_root ;
}
Modified: jifty/trunk/lib/Jifty/View/Mason/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Mason/Handler.pm (original)
+++ jifty/trunk/lib/Jifty/View/Mason/Handler.pm Fri Nov 14 17:34:58 2008
@@ -78,6 +78,8 @@
=cut
sub config {
+ my $self = shift;
+
my %config = (
static_source => 1,
use_object_files => 1,
@@ -104,7 +106,7 @@
unless ( $comp_root and -d $comp_root) {
next;
}
- Jifty->log->debug( "Plugin @{[ref($plugin)]} mason component root added: (@{[$comp_root ||'']})");
+ $plugin->log->debug( "Plugin @{[ref($plugin)]} mason component root added: (@{[$comp_root ||'']})");
push @{ $config{comp_root} }, [ ref($plugin)."-". $root_serial++ => $comp_root ];
}
push @{$config{comp_root}}, [jifty => Jifty->config->framework('Web')->{'DefaultTemplateRoot'}];
Modified: jifty/trunk/lib/Jifty/View/Static/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Static/Handler.pm (original)
+++ jifty/trunk/lib/Jifty/View/Static/Handler.pm Fri Nov 14 17:34:58 2008
@@ -7,7 +7,7 @@
package Jifty::View::Static::Handler;
-use base qw/Jifty::Object/;
+use base qw/Jifty::View/;
our ($MIME,$MAGIC);
@@ -52,7 +52,7 @@
my $root = $plugin->static_root;
if ( -d $root and -r $root ) {
push @roots, $root;
- Jifty->log->debug( "Plugin @{[ref($plugin)]} static root added: (@{[$root ||'']})");
+ $plugin->log->debug( "Plugin @{[ref($plugin)]} static root added: (@{[$root ||'']})");
}
}
push @roots, (Jifty->config->framework('Web')->{DefaultStaticRoot});
Modified: jifty/trunk/lib/Jifty/Web.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web.pm (original)
+++ jifty/trunk/lib/Jifty/Web.pm Fri Nov 14 17:34:58 2008
@@ -830,7 +830,7 @@
my $self = shift;
if (@_ == 1 ) {
- Jifty->log->error("Jifty::Web->tangent takes a paramhash. Perhaps you passed '".$_[0]."' , rather than 'url => ".$_[0]."'");
+ $self->log->error("Jifty::Web->tangent takes a paramhash. Perhaps you passed '".$_[0]."' , rather than 'url => ".$_[0]."'");
die;
}
my $clickable = Jifty::Web::Form::Clickable->new(
Modified: jifty/trunk/lib/Jifty/Web/Form/Element.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Element.pm (original)
+++ jifty/trunk/lib/Jifty/Web/Form/Element.pm Fri Nov 14 17:34:58 2008
@@ -405,7 +405,7 @@
for my $hook (grep {ref $_ eq "HASH"} (@{$value})) {
if (!($self->handler_allowed($trigger))) {
- Jifty->log->error("Handler '$trigger' is not supported for field '" .
+ $self->log->error("Handler '$trigger' is not supported for field '" .
$self->label .
"' with class " . ref $self);
next HANDLER;
More information about the Jifty-commit
mailing list