From: Tomas Doran Date: Wed, 25 Jan 2012 10:22:42 +0000 (+0000) Subject: Deprecate unused private method X-Git-Tag: 5.90008~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=0816209f4514031fe62bdc63d8663ea5a4d1bbda Deprecate unused private method --- diff --git a/Changes b/Changes index 58e7721..7226feb 100644 --- a/Changes +++ b/Changes @@ -16,6 +16,13 @@ Catalyst::Engine::PSGI is now considered fully deprecated. + - The private _dump method in Catalyst::Log is now depreated. The dumper is + not pluggable and which dumper to use should be a user choice. Using + an imported Dump() or Dumper() function is less typing than $c->log->_dump + and as this method is unused anywhere else in Catalyst, it has been scheduled + for removal as a cleanup. Calling this method will now emit a stack trace + on first call (but not on subsequent calls). + Back compatibility fixes: - Applications still using Catalyst::Engine::PSGI as they rely on $c->request->env - this is now the provided (and recommended) way of diff --git a/lib/Catalyst/Log.pm b/lib/Catalyst/Log.pm index 543e30f..b035d89 100644 --- a/lib/Catalyst/Log.pm +++ b/lib/Catalyst/Log.pm @@ -5,6 +5,7 @@ with 'MooseX::Emulate::Class::Accessor::Fast'; use Data::Dump; use Class::MOP (); +use Carp qw/ cluck /; our %LEVELS = (); # Levels stored as bit field, ergo debug = 1, warn = 2 etc our %LEVEL_MATCH = (); # Stored as additive, thus debug = 31, warn = 30 etc @@ -77,8 +78,12 @@ sub disable { $self->level($level); } +our $HAS_DUMPED; sub _dump { my $self = shift; + unless ($HAS_DUMPED++) { + cluck("Catalyst::Log::_dump is deprecated and will be removed. Please change to using your own Dumper.\n"); + } $self->info( Data::Dump::dump(@_) ); }