Class: Picky::Loggers::Silent
Overview
The silent logger just gobbles up all information.
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #adapt ⇒ Object
- #adapt_for_io ⇒ Object
- #adapt_for_logger ⇒ Object
- #dump ⇒ Object
- #flush ⇒ Object
- #info ⇒ Object
-
#initialize(output = STDOUT) ⇒ Silent
constructor
A new instance of Silent.
- #load ⇒ Object
-
#logger_output? ⇒ Boolean
Is the output a logger?.
- #tokenize ⇒ Object
- #warn ⇒ Object
- #write ⇒ Object
Constructor Details
#initialize(output = STDOUT) ⇒ Silent
Returns a new instance of Silent.
11 12 13 14 |
# File 'lib/picky/loggers/silent.rb', line 11 def initialize output = STDOUT @output = output adapt end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
9 10 11 |
# File 'lib/picky/loggers/silent.rb', line 9 def output @output end |
Instance Method Details
#adapt ⇒ Object
26 27 28 |
# File 'lib/picky/loggers/silent.rb', line 26 def adapt logger_output? ? adapt_for_logger : adapt_for_io end |
#adapt_for_io ⇒ Object
35 36 37 38 39 |
# File 'lib/picky/loggers/silent.rb', line 35 def adapt_for_io def flush output.flush end end |
#adapt_for_logger ⇒ Object
30 31 32 33 34 |
# File 'lib/picky/loggers/silent.rb', line 30 def adapt_for_logger def flush end end |
#dump ⇒ Object
57 58 59 |
# File 'lib/picky/loggers/silent.rb', line 57 def dump(*) end |
#flush ⇒ Object
31 32 33 |
# File 'lib/picky/loggers/silent.rb', line 31 def flush end |
#info ⇒ Object
41 42 43 |
# File 'lib/picky/loggers/silent.rb', line 41 def info(*) end |
#load ⇒ Object
61 62 63 |
# File 'lib/picky/loggers/silent.rb', line 61 def load(*) end |
#logger_output? ⇒ Boolean
Is the output a logger?
18 19 20 21 22 23 24 |
# File 'lib/picky/loggers/silent.rb', line 18 def logger_output? output.respond_to?(:fatal) && output.respond_to?(:error) && output.respond_to?(:warn) && output.respond_to?(:info) && output.respond_to?(:debug) end |
#tokenize ⇒ Object
53 54 55 |
# File 'lib/picky/loggers/silent.rb', line 53 def tokenize(*) end |
#warn ⇒ Object
45 46 47 |
# File 'lib/picky/loggers/silent.rb', line 45 def warn(*) end |
#write ⇒ Object
49 50 51 |
# File 'lib/picky/loggers/silent.rb', line 49 def write(*) end |