diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-04-01 16:46:28 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-04-01 16:46:28 +0200 |
commit | 2f8b999750cc700faf03c6aee1c53d1fc4df767f (patch) | |
tree | ef00bf6fd9932fd4fa1fc69e3108a1c5603aa64a /extensions/PhabBugz/lib/Logger.pm | |
parent | c6d0d0e31a8b7b0e3c46ddf0a2be7741716d7977 (diff) | |
parent | 45485679f2e173170ed9c0e8a0eae979fe9de067 (diff) | |
download | bugzilla-2f8b999750cc700faf03c6aee1c53d1fc4df767f.tar.gz bugzilla-2f8b999750cc700faf03c6aee1c53d1fc4df767f.tar.xz |
Merge branch 'master' of git://github.com/mozilla-bteam/bmo
Diffstat (limited to 'extensions/PhabBugz/lib/Logger.pm')
-rw-r--r-- | extensions/PhabBugz/lib/Logger.pm | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/extensions/PhabBugz/lib/Logger.pm b/extensions/PhabBugz/lib/Logger.pm deleted file mode 100644 index 3127b66db..000000000 --- a/extensions/PhabBugz/lib/Logger.pm +++ /dev/null @@ -1,37 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. -# -# This Source Code Form is "Incompatible With Secondary Licenses", as -# defined by the Mozilla Public License, v. 2.0. - -package Bugzilla::Extension::PhabBugz::Logger; - -use 5.10.1; - -use Moo; - -use Bugzilla::Extension::PhabBugz::Constants; - -has 'debugging' => ( is => 'ro' ); - -sub info { shift->_log_it('INFO', @_) } -sub error { shift->_log_it('ERROR', @_) } -sub debug { shift->_log_it('DEBUG', @_) } - -sub _log_it { - my ($self, $method, $message) = @_; - - return if $method eq 'DEBUG' && !$self->debugging; - chomp $message; - if ($ENV{MOD_PERL}) { - require Apache2::Log; - Apache2::ServerRec::warn("FEED $method: $message"); - } elsif ($ENV{SCRIPT_FILENAME}) { - print STDERR "FEED $method: $message\n"; - } else { - print STDERR '[' . localtime(time) ."] $method: $message\n"; - } -} - -1; |