Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions lib/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@
require 'multi_json'

begin
require 'syslog'
HAVE_SYSLOG = true
rescue LoadError
if RUBY_VERSION >= '3.4'
if Gem::Specification.find_all_by_name('syslog').any?
gem 'syslog'
require 'syslog'
HAVE_SYSLOG = true
else
HAVE_SYSLOG = false
end
else
require 'syslog'
HAVE_SYSLOG = true
end
rescue Gem::LoadError, LoadError
HAVE_SYSLOG = false
end

Expand Down