class Backup::Logger::Syslog::Options

Attributes

enabled[R]

Enables logging to the system’s Syslog compatible logger.

This may also be enabled using --syslog on the command line.

If --no-syslog is used on the command line, this will be disabled and any settings here will be ignored.

@param [Boolean, nil] @return [Boolean, nil] Default: false

error[RW]

Specify the priority level to be used for :error messages.

See the Ruby Standard Library documentation for Syslog for more info. rdoc.info/stdlib/syslog/Syslog.log

@param [Integer] @return [Integer] Default: Syslog::LOG_ERR

facility[RW]

Specify the facility to be used with Syslog.

See the Ruby Standard Library documentation for Syslog for more info. rdoc.info/stdlib/syslog/Syslog.open

Note that setting this to nil will cause this to default to a setting of Syslog::LOG_USER

@param [Integer] @return [Integer] Default: Syslog::LOG_LOCAL0

ident[RW]

Specify the identification string to be used with Syslog.

@param [String] @return [String] Default: ‘backup’

info[RW]

Specify the priority level to be used for :info messages.

See the Ruby Standard Library documentation for Syslog for more info. rdoc.info/stdlib/syslog/Syslog.log

@param [Integer] @return [Integer] Default: Syslog::LOG_INFO

options[RW]

Specify the options to be used with Syslog.

See the Ruby Standard Library documentation for Syslog for more info. rdoc.info/stdlib/syslog/Syslog.open

Note that setting this to nil will cause this to default to a setting of +Syslog::LOG_PID | Syslog::LOG_CONS+

@param [Integer] @return [Integer] Default: Syslog::LOG_PID

warn[RW]

Specify the priority level to be used for :warn messages.

See the Ruby Standard Library documentation for Syslog for more info. rdoc.info/stdlib/syslog/Syslog.log

@param [Integer] @return [Integer] Default: Syslog::LOG_WARNING

Public Class Methods

new() click to toggle source
# File lib/backup/logger/syslog.rb, line 82
def initialize
  @enabled = false
  @ident = 'backup'
  @options = ::Syslog::LOG_PID
  @facility = ::Syslog::LOG_LOCAL0
  @info = ::Syslog::LOG_INFO
  @warn = ::Syslog::LOG_WARNING
  @error = ::Syslog::LOG_ERR
end

Public Instance Methods

enabled=(val) click to toggle source
# File lib/backup/logger/syslog.rb, line 96
def enabled=(val)
  @enabled = val unless enabled.nil?
end
enabled?() click to toggle source
# File lib/backup/logger/syslog.rb, line 92
def enabled?
  !!enabled
end