Class: ConfigCat::ConfigCatLogger
- Inherits:
-
Object
- Object
- ConfigCat::ConfigCatLogger
- Defined in:
- lib/configcat/configcatlogger.rb
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #enabled_for?(log_level) ⇒ Boolean
- #error(event_id, message) ⇒ Object
- #info(event_id, message) ⇒ Object
-
#initialize(hooks) ⇒ ConfigCatLogger
constructor
A new instance of ConfigCatLogger.
- #warn(event_id, message) ⇒ Object
Constructor Details
#initialize(hooks) ⇒ ConfigCatLogger
Returns a new instance of ConfigCatLogger.
3 4 5 |
# File 'lib/configcat/configcatlogger.rb', line 3 def initialize(hooks) @hooks = hooks end |
Instance Method Details
#debug(message) ⇒ Object
11 12 13 |
# File 'lib/configcat/configcatlogger.rb', line 11 def debug() ConfigCat.logger.debug("[0] " + ) end |
#enabled_for?(log_level) ⇒ Boolean
7 8 9 |
# File 'lib/configcat/configcatlogger.rb', line 7 def enabled_for?(log_level) ConfigCat.logger.level <= log_level end |
#error(event_id, message) ⇒ Object
23 24 25 26 |
# File 'lib/configcat/configcatlogger.rb', line 23 def error(event_id, ) @hooks.invoke_on_error() ConfigCat.logger.error("[" + event_id.to_s + "] " + ) end |