Module: DebugLogging
- Defined in:
- lib/debug_logging.rb,
lib/debug_logging/util.rb,
lib/debug_logging/hooks.rb,
lib/debug_logging/errors.rb,
lib/debug_logging/version.rb,
lib/debug_logging/finalize.rb,
lib/debug_logging/constants.rb,
lib/debug_logging/class_logger.rb,
lib/debug_logging/configuration.rb,
lib/debug_logging/class_notifier.rb,
lib/debug_logging/log_subscriber.rb,
lib/debug_logging/instance_logger.rb,
lib/debug_logging/argument_printer.rb,
lib/debug_logging/instance_notifier.rb,
lib/debug_logging/instance_logger_modulizer.rb,
lib/debug_logging/instance_notifier_modulizer.rb
Overview
From: stackoverflow.com/a/34559282 License: creativecommons.org/licenses/by-sa/4.0/
Defined Under Namespace
Modules: ApiClassMethods, ArgumentPrinter, ClassLogger, ClassNotifier, ConfigClassMethods, Constants, Finalize, Hooks, InstanceLogger, InstanceLoggerModulizer, InstanceNotifier, InstanceNotifierModulizer, Util, Version Classes: Configuration, Error, LogSubscriber, NoBlockGiven, TimeoutError
Constant Summary collapse
- ACTUAL_NOTHING =
We can’t compare with nil to check for no arguments passed as a configuration value,
because nil can be an argument passed, hence:
Object.new
Class Attribute Summary collapse
-
.debug_logging_configuration ⇒ Object
Returns the value of attribute debug_logging_configuration.
Class Method Summary collapse
-
.configuration ⇒ Object
For single statement global config in an initializer e.g.
-
.configure {|configuration| ... } ⇒ Object
For global config in an initializer with a block.
- .extended(base) ⇒ Object
Class Attribute Details
.debug_logging_configuration ⇒ Object
Returns the value of attribute debug_logging_configuration.
124 125 126 |
# File 'lib/debug_logging.rb', line 124 def debug_logging_configuration @debug_logging_configuration end |
Class Method Details
.configuration ⇒ Object
For single statement global config in an initializer e.g. DebugLogging.configuration.ellipsis = “…”
93 94 95 |
# File 'lib/debug_logging.rb', line 93 def configuration self.debug_logging_configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
For global config in an initializer with a block
98 99 100 |
# File 'lib/debug_logging.rb', line 98 def configure yield(configuration) end |
.extended(base) ⇒ Object
76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/debug_logging.rb', line 76 def extended(base) base.send(:extend, ArgumentPrinter) base.send(:include, ArgumentPrinter) base.send(:extend, ApiClassMethods) base.send(:extend, ConfigClassMethods) base.debug_config_reset(Configuration.new(**debug_logging_configuration.to_hash)) base.class_eval do def base.inherited(subclass) subclass.debug_config_reset(Configuration.new(**debug_config.to_hash)) end end end |