[Rt-commit] rt branch, 4.4/silence-change-of-config-warnings, created. rt-4.4.2-87-gb560c83f0
Maureen Mirville
maureen at bestpractical.com
Thu Apr 5 10:28:07 EDT 2018
The branch, 4.4/silence-change-of-config-warnings has been created
at b560c83f089a63ff9b3ad90905f34f29eb592b91 (commit)
- Log -----------------------------------------------------------------
commit b560c83f089a63ff9b3ad90905f34f29eb592b91
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 configuration option is updated in RT_SiteConfig.pm,
a warning message is added to the logs stating the update will
overwrite its default config option. The behavior the message is
expressing is expected if the change was intentional. This warning
message might not be very helpful to some users and it 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..987149793 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;
+ push @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