class Backup::Logger::Logfile::Options
Attributes
Enable the use of Backup's log file.
While not necessary, as this is true
by default, this may also
be set on the command line using --logfile
.
The use of Backup's log file may be disabled using the command line
option --no-logfile
.
If --no--logfile
is used on the command line, then the log
file will be disabled and any setting here will be ignored.
@param [Boolean, nil] @return [Boolean, nil] Default: true
Backup's logfile in which backup logs can be written
As there is already a #log_path, this can simply be just a file name that will be created (If not exists) on #log_path directory
This may also be set on the command line using --log-file
. If
set on the command line, any setting here will be ignored.
@param [String] @return [String] Default: 'backup.log'
Path to directory where Backup's logfile will be written.
This may be given as an absolute path, or a path relative to Backup's
--root-path
(which defaults to +~/Backup+).
This may also be set on the command line using --log-path
. If
set on the command line, any setting here will be ignored.
@param [String] @return [String] Default: 'log'
Size in bytes to truncate logfile to before backup jobs are run.
This is done once before all triggers
, so the maximum logfile
size would be this value plus whatever the jobs produce.
@param [Integer] @return [Integer] Default: 500_000
Public Class Methods
# File lib/backup/logger/logfile.rb, line 60 def initialize @enabled = true @log_path = '' @max_bytes = 500_000 end
Public Instance Methods
# File lib/backup/logger/logfile.rb, line 70 def enabled=(val) @enabled = val unless enabled.nil? end
# File lib/backup/logger/logfile.rb, line 66 def enabled? !!enabled end
# File lib/backup/logger/logfile.rb, line 74 def log_path=(val) @log_path = val.to_s.strip if log_path.empty? end