Class: DohLogger::IOStreamAcceptor
- Defined in:
- lib/doh/logger/iostream_acceptor.rb
Instance Attribute Summary collapse
-
#ios ⇒ Object
readonly
Returns the value of attribute ios.
Instance Method Summary collapse
- #flush_always(flag = true) ⇒ Object
-
#initialize(ios = nil, format = nil, error_format = nil) ⇒ IOStreamAcceptor
constructor
A new instance of IOStreamAcceptor.
- #log(event) ⇒ Object
Constructor Details
#initialize(ios = nil, format = nil, error_format = nil) ⇒ IOStreamAcceptor
Returns a new instance of IOStreamAcceptor.
7 8 9 10 11 |
# File 'lib/doh/logger/iostream_acceptor.rb', line 7 def initialize(ios = nil, format = nil, error_format = nil) @ios = ios || STDOUT @standard_formatter = format ? Formatter.new(format) : OptimizedStandardFormatter.new @error_formatter = Formatter.new(error_format || format || "%datetime [%severity] (%location) : %msg\nexception: %exception\nstack:\n%call_stack") end |
Instance Attribute Details
#ios ⇒ Object (readonly)
Returns the value of attribute ios.
6 7 8 |
# File 'lib/doh/logger/iostream_acceptor.rb', line 6 def ios @ios end |
Instance Method Details
#flush_always(flag = true) ⇒ Object
13 14 15 |
# File 'lib/doh/logger/iostream_acceptor.rb', line 13 def flush_always(flag = true) @flush = flag end |