Class: Camayoc::Handlers::IO

Inherits:
Logger
  • Object
show all
Includes:
ThreadSafety
Defined in:
lib/camayoc/handlers/io.rb

Overview

Write to a raw IO stream with optional thread-safe locking before writing to the stream. By default, each stat message is written on a single line using puts. See the options in Camayoc::Handlers:Logger for options.

Instance Attribute Summary

Attributes inherited from Logger

#formatter, #logger, #method

Instance Method Summary collapse

Methods included from ThreadSafety

#synchronize, #thread_safe=, #thread_safe?

Methods inherited from Logger

#default_formatter, #event

Constructor Details

#initialize(io = $stdout, options = {}, &block) ⇒ IO

Returns a new instance of IO.



11
12
13
14
# File 'lib/camayoc/handlers/io.rb', line 11

def initialize(io=$stdout,options={},&block)
  super(io,{:method=>:puts}.merge(options),&block)
  self.thread_safe = Camayoc.thread_safe?
end