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, InstanceLoggerModulizer, InstanceNotifierModulizer, Util, Version Classes: Configuration, Error, InstanceLogger, InstanceNotifier, LogSubscriber, NoBlockGiven, TimeoutError
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.
117 118 119 |
# File 'lib/debug_logging.rb', line 117 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 = “…”
87 88 89 |
# File 'lib/debug_logging.rb', line 87 def self.configuration self.debug_logging_configuration ||= Configuration.new end |
.configure {|configuration| ... } ⇒ Object
For global config in an initializer with a block
92 93 94 |
# File 'lib/debug_logging.rb', line 92 def self.configure yield(configuration) end |
.extended(base) ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/debug_logging.rb', line 71 def self.extended(base) base.send(:extend, 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 |