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.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/steno/record.rb', line 27 def initialize(source, log_level, , loc = [], data = {}) raise "Log level must be a Symbol" unless log_level.is_a? Symbol = Time.now @source = source @log_level = log_level = .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.
13 14 15 |
# File 'lib/steno/record.rb', line 13 def data @data end |
#fiber_id ⇒ Object (readonly)
Returns the value of attribute fiber_id.
15 16 17 |
# File 'lib/steno/record.rb', line 15 def fiber_id @fiber_id end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
17 18 19 |
# File 'lib/steno/record.rb', line 17 def file @file end |
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
18 19 20 |
# File 'lib/steno/record.rb', line 18 def lineno @lineno end |
#log_level ⇒ Object (readonly)
Returns the value of attribute log_level.
11 12 13 |
# File 'lib/steno/record.rb', line 11 def log_level @log_level end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
10 11 12 |
# File 'lib/steno/record.rb', line 10 def end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
19 20 21 |
# File 'lib/steno/record.rb', line 19 def method @method end |
#process_id ⇒ Object (readonly)
Returns the value of attribute process_id.
16 17 18 |
# File 'lib/steno/record.rb', line 16 def process_id @process_id end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
12 13 14 |
# File 'lib/steno/record.rb', line 12 def source @source end |
#thread_id ⇒ Object (readonly)
Returns the value of attribute thread_id.
14 15 16 |
# File 'lib/steno/record.rb', line 14 def thread_id @thread_id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
9 10 11 |
# File 'lib/steno/record.rb', line 9 def end |