Class: BlackStack::LocalLogger
- Inherits:
-
BaseLogger
- Object
- BaseLogger
- BlackStack::LocalLogger
- Defined in:
- lib/locallogger.rb
Constant Summary
Constants inherited from BaseLogger
BaseLogger::METHODS, BaseLogger::METHOD_LOG, BaseLogger::METHOD_LOGF, BaseLogger::METHOD_LOGS
Instance Attribute Summary
Attributes inherited from BaseLogger
#current_nest_level, #filename, #nest_level, #number_of_lines_in_current_level
Instance Method Summary collapse
- #log(s, datetime = nil) ⇒ Object
- #logf(s, datetime = nil) ⇒ Object
- #logs(s, datetime = nil) ⇒ Object
- #release ⇒ Object
-
#reset ⇒ Object
call the parent class to set the attributes call the save method to store the new attributes into the data file.
Methods inherited from BaseLogger
#done, #error, #initialize, #initialize_attributes, #no, #yes
Constructor Details
This class inherits a constructor from BlackStack::BaseLogger
Instance Method Details
#log(s, datetime = nil) ⇒ Object
12 13 14 15 16 |
# File 'lib/locallogger.rb', line 12 def log(s, datetime=nil) ltext = super(s, datetime) File.open(self.filename, 'a') { |file| file.write(ltext) } ltext end |
#logf(s, datetime = nil) ⇒ Object
26 27 28 29 30 |
# File 'lib/locallogger.rb', line 26 def logf(s, datetime=nil) ltext = super(s, datetime) File.open(self.filename, 'a') { |file| file.write(ltext) } ltext end |
#logs(s, datetime = nil) ⇒ Object
19 20 21 22 23 |
# File 'lib/locallogger.rb', line 19 def logs(s, datetime=nil) ltext = super(s, datetime) File.open(self.filename, 'a') { |file| file.write(ltext) } ltext end |
#release ⇒ Object
33 34 35 |
# File 'lib/locallogger.rb', line 33 def release() BlackStack::LocalLoggerFactory.release(self.filename) end |
#reset ⇒ Object
call the parent class to set the attributes call the save method to store the new attributes into the data file
7 8 9 10 |
# File 'lib/locallogger.rb', line 7 def reset() super BlackStack::LocalLoggerFactory::save(self.filename, self) end |