[svk-commit] r2142 - branches/svk-logging/lib/SVK

stig at bestpractical.com stig at bestpractical.com
Wed Nov 15 12:44:32 EST 2006


Author: stig
Date: Wed Nov 15 12:44:32 2006
New Revision: 2142

Modified:
   branches/svk-logging/lib/SVK/Logger.pm
   branches/svk-logging/lib/SVK/XD.pm

Log:
* log to stdout for now
* converted SVK::XD to use SVK::Logger

Modified: branches/svk-logging/lib/SVK/Logger.pm
==============================================================================
--- branches/svk-logging/lib/SVK/Logger.pm	(original)
+++ branches/svk-logging/lib/SVK/Logger.pm	Wed Nov 15 12:44:32 2006
@@ -9,6 +9,7 @@
 my $conf = q{
   log4perl.rootLogger=INFO, Screen
   log4perl.appender.Screen = Log::Log4perl::Appender::Screen
+  log4perl.appender.Screen.stderr = 0
   log4perl.appender.Screen.layout = PatternLayout
   log4perl.appender.Screen.layout.ConversionPattern = %m%n
 };

Modified: branches/svk-logging/lib/SVK/XD.pm
==============================================================================
--- branches/svk-logging/lib/SVK/XD.pm	(original)
+++ branches/svk-logging/lib/SVK/XD.pm	Wed Nov 15 12:44:32 2006
@@ -23,6 +23,8 @@
 use SVK::Depot;
 use SVK::Config;
 
+use SVK::Logger;
+
 =head1 NAME
 
 SVK::XD - svk depot and checkout handling.
@@ -218,7 +220,7 @@
     $self->{giantlock_handle} or
         die "Internal error: trying to save config without a lock!\n";
 
-    local $SIG{INT} = sub { warn loc("Please hold on a moment. SVK is writing out a critical configuration file.\n")};
+    local $SIG{INT} = sub { $logger->warn( loc("Please hold on a moment. SVK is writing out a critical configuration file.\n"))};
 
     my $file = $self->{statefile};
     my $tmpfile = $file."-$$";
@@ -664,7 +666,7 @@
 	    enumerate ('auto-props',
 		       sub { $self->{svnautoprop}{compile_apr_fnmatch($_[0])} = $_[1]; 1} );
     };
-    warn "Your svn is too old, auto-prop in svn config is not supported: $@\n" if $@;
+    $logger->warn("Your svn is too old, auto-prop in svn config is not supported: $@") if $@;
 }
 
 sub auto_prop {
@@ -1040,11 +1042,11 @@
 		$seen{$copath} = 1;
 		lstat $copath;
 		unless (-e _) {
-		    print loc ("Unknown target: %1.\n", $copath);
+		    $logger->warn( loc ("Unknown target: %1.\n", $copath));
 		    next ENTRY;
 		}
 		unless (-r _) {
-		    print loc ("Warning: %1 is unreadable.\n", $copath);
+		    $logger->warn( loc ("Warning: %1 is unreadable.\n", $copath));
 		    next ENTRY;
 		}
 		$arg{cb_unknown}->($arg{editor}, catdir($arg{entry}, $now), $arg{baton});
@@ -1182,12 +1184,12 @@
     my $st = [lstat ($copath)];
     return '' if !-e _;
     unless (-r _) {
-	print loc ("Warning: $copath is unreadable.\n");
+	$logger->warn( loc ("Warning: $copath is unreadable."));
 	return;
     }
     return ('file', $st) if -f _ or is_symlink;
     return ('directory', $st) if -d _;
-    print loc ("Warning: unsupported node type $copath.\n");
+    $logger->warn( loc ("Warning: unsupported node type $copath."));
     return ('', $st);
 }
 


More information about the svk-commit mailing list