Class: Yell::Adapters::Datefile
- Defined in:
- lib/yell/adapters/datefile.rb
Overview
The Datefile
adapter is similar to the File
adapter. However, it rotates the file at midnight.
Constant Summary collapse
- DefaultDatePattern =
The default date pattern, e.g. “19820114” (14 Jan 1982)
"%Y%m%d"
- Metadata =
Metadata
lambda { |date, pattern| "# -*- #{date.iso8601} (#{date.to_f}) [#{pattern}] -*-" }
- MetadataRegexp =
/^# -\*- (.+) \((\d+\.\d+)\) \[(.+)\] -\*-$/
Constants inherited from Io
Instance Attribute Summary collapse
-
#date_pattern ⇒ Object
The pattern to be used for the files.
-
#keep ⇒ Object
Set the amount of logfiles to keep when rolling over.
-
#symlink ⇒ Object
Tell the adapter to create a symlink onto the currently active (timestamped) file.
Attributes inherited from Io
Attributes included from Formatter::Helpers
Attributes included from Level::Helpers
Method Summary
Methods inherited from Io
Methods inherited from Base
#close, close, #initialize, setup, write, #write
Constructor Details
This class inherits a constructor from Yell::Adapters::Base
Instance Attribute Details
#date_pattern ⇒ Object
The pattern to be used for the files
59 60 61 |
# File 'lib/yell/adapters/datefile.rb', line 59 def date_pattern @date_pattern end |
#keep ⇒ Object
Set the amount of logfiles to keep when rolling over. By default, no files will be cleaned up.
78 79 80 |
# File 'lib/yell/adapters/datefile.rb', line 78 def keep @keep end |
#symlink ⇒ Object
Tell the adapter to create a symlink onto the currently active (timestamped) file. Upon rollover, the symlink is set to the newly created file, and so on.
67 68 69 |
# File 'lib/yell/adapters/datefile.rb', line 67 def symlink @symlink end |