From 7c771430c5e158e7a544774b64cb67709df52a16 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Mon, 5 Mar 2018 19:29:33 -0500 Subject: Bug 1443049 - is_interactive() must be declared before log4perl config is loaded --- Bugzilla/Logging.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'Bugzilla/Logging.pm') 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; -- cgit v1.2.3-24-g4f1b