class Backup::Logger::Logfile::Options

Attributes

enabled[R]

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

log_file[R]

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’

log_path[R]

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’

max_bytes[RW]

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

new() click to toggle source
# File lib/backup/logger/logfile.rb, line 59
def initialize
  @enabled = true
  @log_path = ""
  @max_bytes = 500_000
end

Public Instance Methods

enabled=(val) click to toggle source
# File lib/backup/logger/logfile.rb, line 69
def enabled=(val)
  @enabled = val unless enabled.nil?
end
enabled?() click to toggle source
# File lib/backup/logger/logfile.rb, line 65
def enabled?
  !!enabled
end
log_path=(val) click to toggle source
# File lib/backup/logger/logfile.rb, line 73
def log_path=(val)
  @log_path = val.to_s.strip if log_path.empty?
end