[Slim-Checkins] r11769 - /trunk/server/Slim/Utils/Log.pm

adrian at svn.slimdevices.com adrian at svn.slimdevices.com
Mon Apr 16 12:56:49 PDT 2007


Author: adrian
Date: Mon Apr 16 12:56:49 2007
New Revision: 11769

URL: http://svn.slimdevices.com?rev=11769&view=rev
Log:
Bug: N/A
Description: use --logdir for location of log config file if specified

Modified:
    trunk/server/Slim/Utils/Log.pm

Modified: trunk/server/Slim/Utils/Log.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Utils/Log.pm?rev=11769&r1=11768&r2=11769&view=diff
==============================================================================
--- trunk/server/Slim/Utils/Log.pm (original)
+++ trunk/server/Slim/Utils/Log.pm Mon Apr 16 12:56:49 2007
@@ -82,16 +82,16 @@
 
 	my %config  = ($class->_defaultCategories, $class->_defaultAppenders);
 
+	# If the user passed logdir, that wins when the file callback is run.
+	if ($args->{'logdir'} && -d $args->{'logdir'}) {
+
+		$logDir = $args->{'logdir'};
+	}
+
 	# If the user has specified a log config, or there is a log config written
 	# out (ie: the user has changed settings in the web UI) - look for that.
 	my $logconf = $args->{'logconf'} || $class->defaultConfigFile;
 	my $logtype = $args->{'logtype'} || 'server';
-
-	# If the user passed logdir, that wins when the file callback is run.
-	if ($args->{'logdir'} && -d $args->{'logdir'}) {
-
-		$logDir = $args->{'logdir'};
-	}
 
 	# If the user has specified any --debug commands, parse those.
 	if ($args->{'debug'} || $::logCategories) {
@@ -627,11 +627,11 @@
 sub defaultConfigFile {
 	my $class = shift;
 
-	my $logDir = Slim::Utils::OSDetect::dirsFor('log');
-
-	if (defined $logDir && -d $logDir) {
-
-		return File::Spec->catdir($logDir, 'log.conf');
+	my $dir = $logDir || Slim::Utils::OSDetect::dirsFor('log');;
+
+	if (defined $dir && -d $dir) {
+
+		return File::Spec->catdir($dir, 'log.conf');
 	}
 }
 



More information about the checkins mailing list