[svk-commit] r2138 - in branches/svk-logging: .

stig at bestpractical.com stig at bestpractical.com
Tue Nov 14 16:36:38 EST 2006


Author: stig
Date: Tue Nov 14 16:36:37 2006
New Revision: 2138

Added:
   branches/svk-logging/lib/SVK/Logger.pm
Modified:
   branches/svk-logging/MANIFEST
   branches/svk-logging/Makefile.PL

Log:
add logging module

Modified: branches/svk-logging/MANIFEST
==============================================================================
--- branches/svk-logging/MANIFEST	(original)
+++ branches/svk-logging/MANIFEST	Tue Nov 14 16:36:37 2006
@@ -99,6 +99,7 @@
 lib/SVK/Inspector.pm
 lib/SVK/Inspector/Compat.pm
 lib/SVK/Inspector/Root.pm
+lib/SVK/Logger.pm
 lib/SVK/Log/ChangedPath.pm
 lib/SVK/Log/ChangedPaths.pm
 lib/SVK/Log/Filter.pm

Modified: branches/svk-logging/Makefile.PL
==============================================================================
--- branches/svk-logging/Makefile.PL	(original)
+++ branches/svk-logging/Makefile.PL	Tue Nov 14 16:36:37 2006
@@ -27,6 +27,7 @@
     'Class::Autouse'           => '1.15',
     'App::CLI'                 => '0',
     'List::MoreUtils'          => '0',
+    'Log::Log4perl'            => '0',
     'Class::Accessor::Fast'    => '0',
     'Class::Data::Inheritable' => '0',
     'Path::Class'              => '0.15',

Added: branches/svk-logging/lib/SVK/Logger.pm
==============================================================================
--- (empty file)
+++ branches/svk-logging/lib/SVK/Logger.pm	Tue Nov 14 16:36:37 2006
@@ -0,0 +1,44 @@
+package SVK::Logger;
+use strict;
+use warnings;
+
+=head1 NAME
+
+SVK::Logger - logging framework for SVK
+
+=head1 SYNOPSIS
+
+  use SVK::Logger;
+  
+  $logger->warn('foo');
+  $logger->info('bar');
+  
+or 
+
+  use SVK::Logger '$foo';
+  
+  $foo->error('bad thingimajig');
+
+=head2 DESCRIPTION
+
+SVK::Logger is a wrapper around Log::Log4perl. When using the module, it
+imports into your namespace a variable called $logger (or you can pass a
+variable name to import to decide what the variable should be) with a
+category based on the name of the calling module.
+
+=head1 MOTIVATION
+
+Ideally, for support requests, if something is not going the way it
+should be we should be able to tell people: "rerun the command with the
+SVKDEBUG=1 environment variable set and mail the output to
+$SUPPORTADDRESS":
+
+  env SVKDEBUG=1 svk <command that failed> 2>&1 | mail $SUPPORTADDRESS
+
+
+
+
+
+=cut
+
+1;


More information about the svk-commit mailing list