Class: ChupaText::DefaultLogger
- Inherits:
-
Logger
- Object
- Logger
- ChupaText::DefaultLogger
- Defined in:
- lib/chupa-text/default-logger.rb
Overview
The default logger for ChupaText. Logger options are retrieved from environment variables.
Here are environment variables to be used:
CHUPA_TEXT_LOG_OUTPUT
It specifies log output.
-: ChupaText outputs to the standard output.+: ChupaText outputs to the standard error output.- Others: It is used as file name. ChupaText outputs to the file.
The default is + (the standard error).
CHUPA_TEXT_LOG_ROTATION_PERIOD
It specifies log rotation period.
It is ignored when CHUPA_TEXT_LOG_OUTPUT is - (the standard
output) or + (the standard error output).
daily: Log file is rotated daily.weekly: Log file is rotated weekly.monthly: Log file is rotated monthly.- Others: Invalid value. It is ignored.
CHUPA_TEXT_LOG_N_GENERATIONS
It specifies how many old log files are kept.
It is ignored when (a) CHUPA_TEXT_LOG_OUTPUT is - (the
standard output) or + (the standard error output) or (b)
CHUPA_TEXT_LOG_RATATION_PERIOD is valid value.
The default value is 7.
CHUPA_TEXT_LOG_LEVEL
It specifies log verbosity.
The default value is info.
unknown: ChupaText outputs only unknown messages.fatal: ChupaText outputsunknownlevel messages and unhandleable error messages.error: ChupaText outputsfatallevel messages and handleable error messages.warn: ChupaText outputserrorlevel messages and warning level messages.info: ChupaText outputswarnlevel messages and generic useful information messages.debug: ChupaText outputs all messages.
Defined Under Namespace
Classes: Formatter
Instance Method Summary collapse
-
#initialize ⇒ DefaultLogger
constructor
A new instance of DefaultLogger.
Constructor Details
#initialize ⇒ DefaultLogger
Returns a new instance of DefaultLogger.
74 75 76 77 78 |
# File 'lib/chupa-text/default-logger.rb', line 74 def initialize super(output_device, default_shift_age, default_shift_size) self.level = default_level self.formatter = Formatter.new end |