1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-12-31 11:29:38 +00:00
rackstash/lib/rackstash.rb
Holger Just d6c3111999 Always generate positive object IDs in inspect
Sometimes, object_ids are created as signed Integers which are invalid
in `inspect`. By using the default implementation of `Object#to_s`, we
can get valid object_ids the same way Ruby itself would have created
them.

For a motivation of this change, see

* https://bugs.ruby-lang.org/issues/13397
* https://github.com/ruby-concurrency/concurrent-ruby/pull/651
2017-07-03 13:37:05 +02:00

56 lines
1.1 KiB
Ruby

# Copyright 2017 Holger Just
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE.txt file for details.
require 'set'
require 'rackstash/version'
module Rackstash
SEVERITIES = [
DEBUG = 0,
INFO = 1,
WARN = 2,
ERROR = 3,
FATAL = 4,
UNKNOWN = 5
].freeze
SEVERITY_NAMES = {
'debug' => DEBUG,
'info' => INFO,
'warn' => WARN,
'error' => ERROR,
'fatal' => FATAL,
'unknown' => UNKNOWN
}.freeze
SEVERITY_LABELS = [
'DEBUG'.freeze,
'INFO'.freeze,
'WARN'.freeze,
'ERROR'.freeze,
'FATAL'.freeze,
'ANY'.freeze
].freeze
PROGNAME = "rackstash/v#{Rackstash::VERSION}".freeze
EMPTY_STRING = ''.freeze
EMPTY_SET = Set.new.freeze
# How many decimal places to render on ISO 8601 timestamps
ISO8601_PRECISION = 3
FIELD_MESSAGE = 'message'.freeze
FIELD_TAGS = 'tags'.freeze
FIELD_TIMESTAMP = '@timestamp'.freeze
FIELD_VERSION = '@version'.freeze
end
require 'rackstash/logger'
require 'rackstash/adapters/io'
require 'rackstash/adapters/callable'