Class: Yell::Adapters::File
Overview
The File
adapter is the most basic. As one would expect, it’s used for logging into files.
Direct Known Subclasses
Constant Summary
Constants inherited from Io
Instance Method Summary collapse
-
#initialize(options = {}, &block) ⇒ File
constructor
A new instance of File.
- #Lazily(openthefilehandle) ⇒ Object
Methods inherited from Io
#colorize!, #colorize?, #format, #write
Methods included from Base
#close, #level, #write, #write?
Constructor Details
#initialize(options = {}, &block) ⇒ File
Returns a new instance of File.
10 11 12 13 14 |
# File 'lib/yell/adapters/file.rb', line 10 def initialize( = {}, &block ) super( nil, , &block ) @filename = .fetch(:filename, default_filename) end |
Instance Method Details
#Lazily(openthefilehandle) ⇒ Object
17 18 19 |
# File 'lib/yell/adapters/file.rb', line 17 def stream @stream ||= ::File.open( @filename, ::File::WRONLY|::File::APPEND|::File::CREAT ) end |