Class: LogRotate
- Inherits:
-
Eye::Checker::CustomDefer
- Object
- Eye::Checker::CustomDefer
- LogRotate
- Defined in:
- lib/eye-rotate/log_rotate.rb
Instance Method Summary collapse
- #get_value ⇒ Object
- #good?(v) ⇒ Boolean
-
#initialize(*args) ⇒ LogRotate
constructor
A new instance of LogRotate.
Constructor Details
#initialize(*args) ⇒ LogRotate
Returns a new instance of LogRotate.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/eye-rotate/log_rotate.rb', line 13 def initialize(*args) super fname = if filename filename elsif device && device != :stdall process.config[device] else if process.config[:stdout] != process.config[:stderr] [process.config[:stdout], process.config[:stderr]] else process.config[:stdall] end end @rots = Array(fname).map do |name| Eye::Rotator.new(name, {:min_size => min_size, :gzip => gzip, :count => count}) end end |
Instance Method Details
#get_value ⇒ Object
33 34 35 36 |
# File 'lib/eye-rotate/log_rotate.rb', line 33 def get_value @rots.each &:rotate_if_needed true end |
#good?(v) ⇒ Boolean
38 39 40 |
# File 'lib/eye-rotate/log_rotate.rb', line 38 def good?(v) true end |