Class: Backup::Logger::Logfile::Options
- Inherits:
-
Object
- Object
- Backup::Logger::Logfile::Options
- Defined in:
- lib/backup/logger/logfile.rb
Instance Attribute Summary collapse
-
#enabled ⇒ Boolean?
Enable the use of Backup’s log file.
-
#log_file ⇒ String
readonly
Backup’s logfile in which backup logs can be written.
-
#log_path ⇒ String
Path to directory where Backup’s logfile will be written.
-
#max_bytes ⇒ Integer
Size in bytes to truncate logfile to before backup jobs are run.
Instance Method Summary collapse
- #enabled? ⇒ Boolean
-
#initialize ⇒ Options
constructor
A new instance of Options.
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
61 62 63 64 65 |
# File 'lib/backup/logger/logfile.rb', line 61 def initialize @enabled = true @log_path = '' @max_bytes = 500_000 end |
Instance Attribute Details
#enabled ⇒ Boolean?
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.
23 24 25 |
# File 'lib/backup/logger/logfile.rb', line 23 def enabled @enabled end |
#log_file ⇒ String (readonly)
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.
49 50 51 |
# File 'lib/backup/logger/logfile.rb', line 49 def log_file @log_file end |
#log_path ⇒ String
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.
36 37 38 |
# File 'lib/backup/logger/logfile.rb', line 36 def log_path @log_path end |
#max_bytes ⇒ Integer
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.
59 60 61 |
# File 'lib/backup/logger/logfile.rb', line 59 def max_bytes @max_bytes end |
Instance Method Details
#enabled? ⇒ Boolean
67 68 69 |
# File 'lib/backup/logger/logfile.rb', line 67 def enabled? !!enabled end |