Class: Alephant::Logger::JSON
- Inherits:
-
Object
- Object
- Alephant::Logger::JSON
- Defined in:
- lib/alephant/logger/json.rb,
lib/alephant/logger/json/version.rb
Direct Known Subclasses
Constant Summary collapse
- VERSION =
'0.4.0'.freeze
Class Attribute Summary collapse
-
.session ⇒ Object
Returns the value of attribute session.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(log_path, options = {}) ⇒ JSON
constructor
A new instance of JSON.
Constructor Details
#initialize(log_path, options = {}) ⇒ JSON
Returns a new instance of JSON.
7 8 9 10 11 12 |
# File 'lib/alephant/logger/json.rb', line 7 def initialize(log_path, = {}) @log_file = File.open(log_path, 'a+') @log_file.sync = true @nesting = .fetch(:nesting, false) self.class.session = -> { 'n/a' } unless self.class.session? end |
Class Attribute Details
.session ⇒ Object
Returns the value of attribute session.
31 32 33 |
# File 'lib/alephant/logger/json.rb', line 31 def session @session end |
Class Method Details
.session? ⇒ Boolean
33 34 35 |
# File 'lib/alephant/logger/json.rb', line 33 def session? defined?(@session) end |