]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1443049 - is_interactive() must be declared before log4perl config is loaded
authorDylan William Hardison <dylan@hardison.net>
Tue, 6 Mar 2018 00:29:33 +0000 (19:29 -0500)
committerGitHub <noreply@github.com>
Tue, 6 Mar 2018 00:29:33 +0000 (19:29 -0500)
Bugzilla/Logging.pm

index 1d42f1ffdc7baf1700a48a510c59c85ee29a5421..b69ffa2e916201513fcff69651667d7e48f6db95 100644 (file)
@@ -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;