Sha256: a2b0260c7e89a61bd5f3b3f1b43d3632cfcbd2e518989c432b87f52449037e65
Contents?: true
Size: 1.18 KB
Versions: 13
Compression:
Stored size: 1.18 KB
Contents
require "timber/context" module Timber module Contexts # The runtime context adds current runtime data to your logs, such as the file, line number, # class or module name, etc. This makes it easy to tail and search your logs by their # origin in your code. For example, if you are debugging a specific class, you can narrow # by that class and see only it's logs. class Runtime < Context @keyspace = :runtime attr_reader :application, :class_name, :file, :function, :line, :module_name, :vm_pid def initialize(attributes) @application = attributes[:application] @class_name = attributes[:class_name] @file = attributes[:file] @function = attributes[:function] @line = attributes[:line] @module_name = attributes[:module_name] @vm_pid = Timber::Util::Object.try(attributes[:vm_pid], :to_s) end # Builds a hash representation containing simple objects, suitable for serialization (JSON). def as_json(_options = {}) {application: application, class_name: class_name, file: file, function: function, line: line, module_name: module_name, vm_pid: vm_pid} end end end end
Version data entries
13 entries across 13 versions & 1 rubygems