Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
23 changes: 11 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@ jobs:

matrix:
ruby-version:
- 3.2
- 3.1
- 3.0
- 2.7
- 2.6
- 2.5
- 2.4
- 2.3
- jruby-9.4.3.0
- jruby-9.2.14.0
- truffleruby-23.0.0
- truffleruby-22.1.0
- "3"
- "3.2"
- "3.1"
- "3.0"
- "2.7"
- "2.6"
- "2.5"
- "jruby-9.4.3.0"
- "jruby-9.2.14.0"
- "truffleruby-23.0.0"
- "truffleruby-22.1.0"

steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ gemspec
gem "rake", "~> 13.0"

gem "rspec", "~> 3.0"
gem "base64" if RUBY_VERSION >= "3.4.0"
2 changes: 1 addition & 1 deletion example-project/main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
exit
end
# Create logger
http_device = Logtail::LogDevices::HTTP.new(ARGV[0], ingesting_host: ARGV[1])
http_device = Logtail::LogDevices::HTTP.new(ARGV[0], logtail_host: ARGV[1])
logger = Logtail::Logger.new(http_device)

# Filter logs that shouldn't be sent to Better Stack, see {Logtail::LogEntry} for available attributes
Expand Down
8 changes: 4 additions & 4 deletions lib/logtail/log_devices/http.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HTTP
DEFAULT_INGESTING_PORT = 443
DEFAULT_INGESTING_SCHEME = "https".freeze
CONTENT_TYPE = "application/msgpack".freeze
USER_AGENT = "Better Stack Telemetry for Ruby/#{Logtail::VERSION} (HTTP)".freeze
USER_AGENT = "Logtail Ruby/#{Logtail::VERSION} (HTTP)".freeze

# Instantiates a new HTTP log device that can be passed to {Logtail::Logger#initialize}.
#
Expand Down Expand Up @@ -69,9 +69,9 @@ class HTTP
# Logtail::Logger.new(http_log_device)
def initialize(source_token, options = {})
# Handle backward-compatibility of argument names
options[:ingesting_host] ||= options[:ingesting_host] if options[:ingesting_host].present?
options[:ingesting_port] ||= options[:logtail_port] if options[:logtail_port].present?
options[:ingesting_scheme] ||= options[:logtail_scheme] if options[:logtail_scheme].present?
options[:ingesting_host] ||= options[:logtail_host]
options[:ingesting_port] ||= options[:logtail_port]
options[:ingesting_scheme] ||= options[:logtail_scheme]

@source_token = source_token || raise(ArgumentError.new("The source_token parameter cannot be blank"))
@ingesting_host = options[:ingesting_host] || ENV['INGESTING_HOST'] || ENV['LOGTAIL_HOST'] || DEFAULT_INGESTING_HOST
Expand Down
Loading