Class: Startback::Support::FakeLogger
- Defined in:
- lib/startback/support/fake_logger.rb
Instance Attribute Summary collapse
-
#formatter ⇒ Object
Returns the value of attribute formatter.
-
#seen ⇒ Object
readonly
Returns the value of attribute seen.
Instance Method Summary collapse
- #format(severity, message) ⇒ Object
-
#initialize(*args) ⇒ FakeLogger
constructor
A new instance of FakeLogger.
- #last_msg ⇒ Object
Methods inherited from Logger
Constructor Details
#initialize(*args) ⇒ FakeLogger
Returns a new instance of FakeLogger.
5 6 7 |
# File 'lib/startback/support/fake_logger.rb', line 5 def initialize(*args) @seen = [] end |
Instance Attribute Details
#formatter ⇒ Object
Returns the value of attribute formatter.
8 9 10 |
# File 'lib/startback/support/fake_logger.rb', line 8 def formatter @formatter end |
#seen ⇒ Object (readonly)
Returns the value of attribute seen.
9 10 11 |
# File 'lib/startback/support/fake_logger.rb', line 9 def seen @seen end |
Instance Method Details
#format(severity, message) ⇒ Object
21 22 23 24 25 |
# File 'lib/startback/support/fake_logger.rb', line 21 def format(severity, ) return unless formatter formatter.call(severity.to_s.upcase, Time.now, 'prognam', ) end |
#last_msg ⇒ Object
11 12 13 |
# File 'lib/startback/support/fake_logger.rb', line 11 def last_msg seen.last end |