Class: Logx::Canonical
- Inherits:
-
Object
- Object
- Logx::Canonical
- Defined in:
- lib/logx/canonical.rb
Instance Attribute Summary collapse
-
#log ⇒ Object
readonly
Returns the value of attribute log.
Instance Method Summary collapse
- #append(**kwargs) ⇒ Object
- #flush ⇒ Object
-
#initialize(log) ⇒ Canonical
constructor
A new instance of Canonical.
Constructor Details
#initialize(log) ⇒ Canonical
Returns a new instance of Canonical.
8 9 10 |
# File 'lib/logx/canonical.rb', line 8 def initialize(log) @log = log end |
Instance Attribute Details
#log ⇒ Object (readonly)
Returns the value of attribute log.
6 7 8 |
# File 'lib/logx/canonical.rb', line 6 def log @log end |
Instance Method Details
#append(**kwargs) ⇒ Object
17 18 19 |
# File 'lib/logx/canonical.rb', line 17 def append(**kwargs) CurrentBuffer.append(**kwargs) end |
#flush ⇒ Object
12 13 14 15 |
# File 'lib/logx/canonical.rb', line 12 def flush log.info CurrentBuffer.contents.to_json CurrentBuffer.reset end |