X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT.pm;h=e71d6c926fa36ea880cecefb06b8540c5db33b2a;hb=0ea23112cfa0d82738b0f08d60d90579721b7524;hp=da60ef77d34e501f1d5cca69c4ca921c0cfa427a;hpb=679854b8bbc65d112071111bbd7f34a6a481fb30;p=freeside.git diff --git a/rt/lib/RT.pm b/rt/lib/RT.pm index da60ef77d..e71d6c926 100644 --- a/rt/lib/RT.pm +++ b/rt/lib/RT.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -181,8 +181,8 @@ up logging|/InitLogging>, and L. =cut sub Init { - - my @arg = @_; + shift if @_%2; # code is inconsistent about calling as method + my %args = (@_); CheckPerlRequirements(); @@ -191,8 +191,8 @@ sub Init { #Get a database connection ConnectToDatabase(); InitSystemObjects(); - InitClasses(); - InitLogging(@arg); + InitClasses(%args); + InitLogging(%args); InitPlugins(); RT::I18N->Init; RT->Config->PostLoadCheck; @@ -264,7 +264,7 @@ sub InitLogging { my ($package, $filename, $line) = caller($frame); $p{'message'} =~ s/(?:\r*\n)+$//; - return "[". gmtime(time) ."] [". $p{'level'} ."]: " + return "[$$] [". gmtime(time) ."] [". $p{'level'} ."]: " . $p{'message'} ." ($filename:$line)\n"; }; @@ -283,9 +283,9 @@ sub InitLogging { $p{message} =~ s/(?:\r*\n)+$//; if ($p{level} eq 'debug') { - return "$p{message}\n"; + return "[$$] $p{message} ($filename:$line)\n"; } else { - return "$p{message} ($filename:$line)\n"; + return "[$$] $p{message}\n"; } }; @@ -707,7 +707,9 @@ sub InitPluginPaths { my @tmp_inc; my $added; for (@INC) { - if ( Cwd::realpath($_) eq $RT::LocalLibPath) { + my $realpath = Cwd::realpath($_); + next unless defined $realpath; + if ( $realpath eq $RT::LocalLibPath) { push @tmp_inc, $_, @lib_dirs; $added = 1; } else {