This class defines the rotation strategy contract. Classes that implement rotation strategies need not subclass this base class, but must implement the methods defined here.
This base class itself merely writes to STDOUT and does not do any rotation.
This is a hook that is called before every write request to any stream managed by this rotater. You may optionally perform any periodic tasks here, such as renaming log files.
# File lib/sawmill/rotater/base.rb, line 81 def before_write end
Close the IO object for the given handle. This is guaranteed not be called unless the stream has been opened.
# File lib/sawmill/rotater/base.rb, line 73 def close_handle(handle_, io_) end
Open and return an IO object for the given handle. This is guaranteed not to be called twice unless the stream has been closed in the meantime.
# File lib/sawmill/rotater/base.rb, line 65 def open_handle(handle_) ::STDOUT end
Return the currently preferred handle, identifying which io stream should be written to preferentially unless a channel is constrained to use an earlier stream.
# File lib/sawmill/rotater/base.rb, line 56 def preferred_handle 0 end