[Rt-commit] rt branch, 4.4/silence-change-of-config-warnings, created. rt-4.4.2-65-geef02011d

Maureen Mirville maureen at bestpractical.com
Wed Jan 24 15:59:49 EST 2018


The branch, 4.4/silence-change-of-config-warnings has been created
        at  eef02011d73da7a8035e99369d1ea911a7cff7a9 (commit)

- Log -----------------------------------------------------------------
commit eef02011d73da7a8035e99369d1ea911a7cff7a9
Author: Maureen E. Mirville <maureen at bestpractical.com>
Date:   Mon Jan 22 16:14:09 2018 -0500

    Add option to silence 'Change of config' warnings
    
    When an RTIR config option is updated in RT_SiteConfig.pm, a
    warning message is added to the logs stating the update will
    overwrite the default config option. This behavior the message is
    expressing is expected if the change was intentional. This warning
    message might not be very helpful to some users and creates
    additional noise in the logs. This warning message has been moved
    to the debug level to allow users the option to view these messages
    or not by enabling or disabling 'debug' with the RT config
    $LogToSTDERR.

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index e73273012..da65b47ea 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1643,7 +1643,8 @@ sub SetFromConfig {
                 # as a site config is loaded earlier then its base config
                 # then we warn only on different extensions, for example
                 # RTIR's options is set in main site config
-                warn
+                our $ConfigChangeWarning;
+                $ConfigChangeWarning =
                     "Change of config option '$name' at $args{'File'} line $args{'Line'} has been ignored."
                     ." It may be ok, but we want you to be aware."
                     ." This option has been set earlier in $source{'File'} line $source{'Line'}."
diff --git a/sbin/rt-server.in b/sbin/rt-server.in
index d7b736565..084386bdf 100644
--- a/sbin/rt-server.in
+++ b/sbin/rt-server.in
@@ -90,6 +90,9 @@ die "Wrong version of RT $RT::VERSION found; need @RT_VERSION_MAJOR at .@RT_VERSION
 RT->LoadConfig();
 RT->InitPluginPaths();
 RT->InitLogging();
+if ( $RT::Config::ConfigChangeWarning ) {
+    $RT::Logger->debug( $RT::Config::ConfigChangeWarning );
+}
 
 require RT::Handle;
 my ($integrity, $state, $msg) = RT::Handle->CheckIntegrity;

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


More information about the rt-commit mailing list