[Bps-public-commit] rtx-migrate branch, master, updated. 0.14-5-g3d6cd79

Alex Vandiver alexmv at bestpractical.com
Mon Dec 30 19:39:51 EST 2013


The branch, master has been updated
       via  3d6cd798344165be150eb62ee05265ef2b7173e7 (commit)
      from  9b6a53a773fb4806cc61b8d069e5a54c121ba454 (commit)

Summary of changes:
 lib/RT/Migrate.pm | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 3d6cd798344165be150eb62ee05265ef2b7173e7
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Nov 27 18:18:09 2013 -0500

    Setting $RT::LogToScreen doesn't change logging
    
    While RT->Config->Set('LogToScreen','error') sets $RT::LogToScreen for
    backcompat, we don't read from $RT::LogToScreen when calling
    RT->Config->Get('LogToScreen');
    
    This exposes a number of suppressed warnings when running rt-serializer
    against 4.2-trunk.
    
        LogToScreen is deprecated for LogToSTDERR.
        Case sensitive search by Groups.Domain
        Use of RT::Tickets::_SQLLimit in Queue.pm
    
    Since parts of this need to go back into rtx-migrate and we need to
    maintain backcompat in rt-serializer as much as possible (for
    incremental upgrades) cleanup of these will come in separate commits.

diff --git a/lib/RT/Migrate.pm b/lib/RT/Migrate.pm
index 0eef366..eb6b6b9 100644
--- a/lib/RT/Migrate.pm
+++ b/lib/RT/Migrate.pm
@@ -176,11 +176,20 @@ sub progress {
 sub setup_logging {
     my ($dir, $file) = @_;
 
-    $RT::LogToScreen    = 'warning';
-    $RT::LogToFile      = 'warning';
-    $RT::LogDir         = $dir;
-    $RT::LogToFileNamed = $file;
-    $RT::LogStackTraces = 'error';
+
+    if ( RT->can('Config') && RT->Config->can('Set') ) {
+        RT->Config->Set(LogToScreen    => 'warning');
+        RT->Config->Set(LogToFile      => 'warning');
+        RT->Config->Set(LogDir         => $dir);
+        RT->Config->Set(LogToFileNamed => $file);
+        RT->Config->Set(LogStackTraces => 'error');
+    } else { # running before 3.8
+        $RT::LogToScreen    = 'warning';
+        $RT::LogToFile      = 'warning';
+        $RT::LogDir         = $dir;
+        $RT::LogToFileNamed = $file;
+        $RT::LogStackTraces = 'error';
+    }
 
     undef $RT::Logger;
     RT->InitLogging();

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list