Class: Steno::Record
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#fiber_id ⇒ Object
readonly
Returns the value of attribute fiber_id.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
-
#log_level ⇒ Object
readonly
Returns the value of attribute log_level.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#process_id ⇒ Object
readonly
Returns the value of attribute process_id.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#thread_id ⇒ Object
readonly
Returns the value of attribute thread_id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(source, log_level, message, loc = [], data = {}) ⇒ Record
constructor
A new instance of Record.
Constructor Details
#initialize(source, log_level, message, loc = [], data = {}) ⇒ Record
Returns a new instance of Record.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/steno/record.rb', line 17 def initialize(source, log_level, , loc = [], data = {}) raise 'Log level must be a Symbol' unless log_level.is_a? Symbol @timestamp = Time.now @source = source @log_level = log_level @message = .to_s @data = {}.merge(data) @thread_id = Thread.current.object_id @fiber_id = Fiber.current.object_id @process_id = Process.pid @file, @lineno, @method = loc end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def data @data end |
#fiber_id ⇒ Object (readonly)
Returns the value of attribute fiber_id.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def fiber_id @fiber_id end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def file @file end |
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def lineno @lineno end |
#log_level ⇒ Object (readonly)
Returns the value of attribute log_level.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def log_level @log_level end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def @message end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def method @method end |
#process_id ⇒ Object (readonly)
Returns the value of attribute process_id.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def process_id @process_id end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def source @source end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def thread_id @thread_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
8 9 10 |
# File 'lib/steno/record.rb', line 8 def @timestamp end |