1
0
mirror of https://github.com/meineerde/rackstash.git synced 2025-10-17 14:01:01 +00:00
rackstash/lib/rackstash.rb
Holger Just 551b75c65d Add fields and tags to the Buffer
Each buffer instance can hold messages, fields and tags. These together
form the log event which will eventually be written to the log target.

By adding fields and tags, you can add highly details structured
information to your logs which allow to filter and analyze the logs
without having to parse complex multi-line logs.
2017-02-02 23:55:02 +01:00

35 lines
706 B
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
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'