Class: Fluent::Test::DummyLogDevice
- Inherits:
-
Object
- Object
- Fluent::Test::DummyLogDevice
- Defined in:
- lib/fluent/test/log.rb
Instance Attribute Summary collapse
-
#flush_logs ⇒ Object
Returns the value of attribute flush_logs.
-
#logs ⇒ Object
readonly
Returns the value of attribute logs.
Instance Method Summary collapse
- #close ⇒ Object
- #flush ⇒ Object
-
#initialize ⇒ DummyLogDevice
constructor
A new instance of DummyLogDevice.
- #puts(*args) ⇒ Object
- #reset ⇒ Object
- #tty? ⇒ Boolean
- #write(message) ⇒ Object
Constructor Details
#initialize ⇒ DummyLogDevice
Returns a new instance of DummyLogDevice.
26 27 28 29 30 |
# File 'lib/fluent/test/log.rb', line 26 def initialize @logs = [] @flush_logs = true @use_stderr = false end |
Instance Attribute Details
#flush_logs ⇒ Object
Returns the value of attribute flush_logs.
24 25 26 |
# File 'lib/fluent/test/log.rb', line 24 def flush_logs @flush_logs end |
#logs ⇒ Object (readonly)
Returns the value of attribute logs.
23 24 25 |
# File 'lib/fluent/test/log.rb', line 23 def logs @logs end |
Instance Method Details
#close ⇒ Object
55 56 57 |
# File 'lib/fluent/test/log.rb', line 55 def close true end |
#flush ⇒ Object
51 52 53 |
# File 'lib/fluent/test/log.rb', line 51 def flush true end |
#puts(*args) ⇒ Object
40 41 42 |
# File 'lib/fluent/test/log.rb', line 40 def puts(*args) args.each{ |arg| write(arg + "\n") } end |
#reset ⇒ Object
32 33 34 |
# File 'lib/fluent/test/log.rb', line 32 def reset @logs = [] if @flush_logs end |
#tty? ⇒ Boolean
36 37 38 |
# File 'lib/fluent/test/log.rb', line 36 def tty? false end |
#write(message) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/fluent/test/log.rb', line 44 def write() if @use_stderr STDERR.write end @logs.push end |