From: Dylan William Hardison Date: Tue, 6 Mar 2018 00:29:33 +0000 (-0500) Subject: Bug 1443049 - is_interactive() must be declared before log4perl config is loaded X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c771430c5e158e7a544774b64cb67709df52a16;p=thirdparty%2Fbugzilla.git Bug 1443049 - is_interactive() must be declared before log4perl config is loaded --- diff --git a/Bugzilla/Logging.pm b/Bugzilla/Logging.pm index 1d42f1ffd..b69ffa2e9 100644 --- a/Bugzilla/Logging.pm +++ b/Bugzilla/Logging.pm @@ -16,6 +16,10 @@ use File::Spec::Functions qw(rel2abs); use Bugzilla::Constants qw(bz_locations); use English qw(-no_match_vars $PROGRAM_NAME); +sub is_interactive { + return exists $ENV{'SERVER_SOFTWARE'} ? 1 : 0; +} + BEGIN { my $file = $ENV{LOG4PERL_CONFIG_FILE} // 'log4perl-syslog.conf'; Log::Log4perl::Logger::create_custom_level('NOTICE', 'WARN', 5, 2); @@ -106,9 +110,4 @@ sub import { ); } -sub is_interactive { - state $is_tty = -t STDOUT || -t STDIN; - return $is_tty || $ENV{"Bugzilla.pm"} && Bugzilla->usage_mode == Bugzilla::Constants::USAGE_MODE_CMDLINE; -} - 1;