Class: Backup::Logger::Syslog::Options
- Inherits:
-
Object
- Object
- Backup::Logger::Syslog::Options
- Defined in:
- lib/backup/logger/syslog.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Boolean?
Enables logging to the system’s Syslog compatible logger.
-
#error ⇒ Integer
Specify the priority level to be used for
:error
messages. -
#facility ⇒ Integer
Specify the facility to be used with Syslog.
-
#ident ⇒ String
Specify the identification string to be used with Syslog.
-
#info ⇒ Integer
Specify the priority level to be used for
:info
messages. -
#options ⇒ Integer
Specify the options to be used with Syslog.
-
#warn ⇒ Integer
Specify the priority level to be used for
:warn
messages.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
82 83 84 85 86 87 88 89 90 |
# 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 |
Instance Attribute Details
#enabled ⇒ Boolean?
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.
17 18 19 |
# File 'lib/backup/logger/syslog.rb', line 17 def enabled @enabled end |
#error ⇒ Integer
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
80 81 82 |
# File 'lib/backup/logger/syslog.rb', line 80 def error @error end |
#facility ⇒ Integer
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
50 51 52 |
# File 'lib/backup/logger/syslog.rb', line 50 def facility @facility end |
#ident ⇒ String
Specify the identification string to be used with Syslog.
24 25 26 |
# File 'lib/backup/logger/syslog.rb', line 24 def ident @ident end |
#info ⇒ Integer
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
60 61 62 |
# File 'lib/backup/logger/syslog.rb', line 60 def info @info end |
#options ⇒ Integer
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
37 38 39 |
# File 'lib/backup/logger/syslog.rb', line 37 def @options end |
#warn ⇒ Integer
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
70 71 72 |
# File 'lib/backup/logger/syslog.rb', line 70 def warn @warn end |
Instance Method Details
#enabled? ⇒ Boolean
92 93 94 |
# File 'lib/backup/logger/syslog.rb', line 92 def enabled? !!enabled end |