summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-03-06 01:29:33 +0100
committerGitHub <noreply@github.com>2018-03-06 01:29:33 +0100
commit7c771430c5e158e7a544774b64cb67709df52a16 (patch)
treee9e930aa04bf28b2c897a471de347f07f5d1f06c /Bugzilla
parentf19ca3cf1d7cae69c0419a16d2847f46baf2a287 (diff)
downloadbugzilla-7c771430c5e158e7a544774b64cb67709df52a16.tar.gz
bugzilla-7c771430c5e158e7a544774b64cb67709df52a16.tar.xz
Bug 1443049 - is_interactive() must be declared before log4perl config is loaded
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Logging.pm9
1 files changed, 4 insertions, 5 deletions
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;