debug_logging 1.0.10 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +5 -5
 - data/lib/debug_logging/class_logger.rb +10 -3
 - data/lib/debug_logging/instance_logger_modulizer.rb +12 -4
 - data/lib/debug_logging/version.rb +1 -1
 - data/lib/simple_debug_logging.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 6ea3afaf91b55426d0c4f6674c0515a261dfa77e
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 537a3865676eda1263d32ed4a63b08644724cca6
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 5185c10484ed70e559c6b97671e2b64b4e4d70a65db62f09f9e6af07b4bda6d288887bfd7675d22b9989c5542a36ebee354d0638b48854daf1096d04b3b6fcd6
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 500daf82402c0709b67c016f4e03b7d96a605949f9255bdb54269577952b55ff1d691acecc8202a25e1082afe0d0a4bd02438593e3a4d2216606727e686b28e8
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -17,11 +17,11 @@ Unobtrusive, inheritable-overridable-configurable, drop-in debug logging, that w 
     | 
|
| 
       17 
17 
     | 
    
         
             
            | license                 |  [](https://opensource.org/licenses/MIT) |
         
     | 
| 
       18 
18 
     | 
    
         
             
            | expert support          |  [](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) |
         
     | 
| 
       19 
19 
     | 
    
         
             
            | download rank               |  [](https://rubygems.org/gems/debug_logging) |
         
     | 
| 
       20 
     | 
    
         
            -
            | version                 |  [](http://badge.fury.io/rb/debug_logging) |
         
     | 
| 
      
 21 
     | 
    
         
            +
            | dependencies            |  [](https://gemnasium.com/pboling/debug_logging) |
         
     | 
| 
      
 22 
     | 
    
         
            +
            | code quality            |  [](https://codeclimate.com/github/pboling/debug_logging) |
         
     | 
| 
      
 23 
     | 
    
         
            +
            | continuous integration  |  [](https://travis-ci.org/pboling/debug_logging) |
         
     | 
| 
      
 24 
     | 
    
         
            +
            | test coverage           |  [](https://coveralls.io/r/pboling/debug_logging) |
         
     | 
| 
       25 
25 
     | 
    
         
             
            | homepage                |  [https://github.com/pboling/debug_logging][homepage] |
         
     | 
| 
       26 
26 
     | 
    
         
             
            | documentation           |  [http://rdoc.info/github/pboling/debug_logging/frames][documentation] |
         
     | 
| 
       27 
27 
     | 
    
         
             
            | live chat               |  [](https://gitter.im/pboling/debug_logging?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
         
     | 
| 
         @@ -13,12 +13,19 @@ module DebugLogging 
     | 
|
| 
       13 
13 
     | 
    
         
             
                    original_method = method(method_to_log)
         
     | 
| 
       14 
14 
     | 
    
         
             
                    (class << self; self; end).class_eval do
         
     | 
| 
       15 
15 
     | 
    
         
             
                      define_method(method_to_log) do |*args, &block|
         
     | 
| 
       16 
     | 
    
         
            -
                        config_proxy = if  
     | 
| 
       17 
     | 
    
         
            -
                                          
     | 
| 
      
 16 
     | 
    
         
            +
                        config_proxy = if (proxy = instance_variable_get("@debug_config_proxy_for_k_#{method_to_log}".to_sym))
         
     | 
| 
      
 17 
     | 
    
         
            +
                                         proxy
         
     | 
| 
       18 
18 
     | 
    
         
             
                                       else
         
     | 
| 
       19 
     | 
    
         
            -
                                          
     | 
| 
      
 19 
     | 
    
         
            +
                                         proxy = if opts
         
     | 
| 
      
 20 
     | 
    
         
            +
                                                   Configuration.new(**(debug_config.to_hash.merge(opts)))
         
     | 
| 
      
 21 
     | 
    
         
            +
                                                 else
         
     | 
| 
      
 22 
     | 
    
         
            +
                                                   self
         
     | 
| 
      
 23 
     | 
    
         
            +
                                                 end
         
     | 
| 
      
 24 
     | 
    
         
            +
                                         instance_variable_set("@debug_config_proxy_for_k_#{method_to_log}".to_sym, proxy)
         
     | 
| 
      
 25 
     | 
    
         
            +
                                         proxy
         
     | 
| 
       20 
26 
     | 
    
         
             
                                       end
         
     | 
| 
       21 
27 
     | 
    
         
             
                        method_return_value = nil
         
     | 
| 
      
 28 
     | 
    
         
            +
                        # TODO: Put all the logic into a logger block, so it will never be computed at runtime if the log level is too high
         
     | 
| 
       22 
29 
     | 
    
         
             
                        log_prefix = debug_invocation_to_s(klass: self.to_s, separator: ".", method_to_log: method_to_log, config_proxy: config_proxy)
         
     | 
| 
       23 
30 
     | 
    
         
             
                        signature = debug_signature_to_s(args: args, config_proxy: config_proxy)
         
     | 
| 
       24 
31 
     | 
    
         
             
                        invocation_id = debug_invocation_id_to_s(args: args, config_proxy: config_proxy)
         
     | 
| 
         @@ -4,13 +4,21 @@ module DebugLogging 
     | 
|
| 
       4 
4 
     | 
    
         
             
                  Module.new do
         
     | 
| 
       5 
5 
     | 
    
         
             
                    Array(methods_to_log).each do |method_to_log|
         
     | 
| 
       6 
6 
     | 
    
         
             
                      # method name must be a symbol
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
       7 
8 
     | 
    
         
             
                      define_method(method_to_log.to_sym) do |*args, &block|
         
     | 
| 
       8 
     | 
    
         
            -
                         
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
      
 9 
     | 
    
         
            +
                        method_return_value = nil
         
     | 
| 
      
 10 
     | 
    
         
            +
                        config_proxy = if (proxy = instance_variable_get("@debug_config_proxy_for_#{method_to_log}".to_sym))
         
     | 
| 
      
 11 
     | 
    
         
            +
                                         proxy
         
     | 
| 
       10 
12 
     | 
    
         
             
                                       else
         
     | 
| 
       11 
     | 
    
         
            -
                                          
     | 
| 
      
 13 
     | 
    
         
            +
                                         proxy = if config
         
     | 
| 
      
 14 
     | 
    
         
            +
                                                   Configuration.new(**(self.class.debug_config.to_hash.merge(config))) 
         
     | 
| 
      
 15 
     | 
    
         
            +
                                                 else
         
     | 
| 
      
 16 
     | 
    
         
            +
                                                   self.class
         
     | 
| 
      
 17 
     | 
    
         
            +
                                                 end
         
     | 
| 
      
 18 
     | 
    
         
            +
                                         instance_variable_set("@debug_config_proxy_for_#{method_to_log}".to_sym, proxy)
         
     | 
| 
      
 19 
     | 
    
         
            +
                                         proxy
         
     | 
| 
       12 
20 
     | 
    
         
             
                                       end
         
     | 
| 
       13 
     | 
    
         
            -
                         
     | 
| 
      
 21 
     | 
    
         
            +
                        # TODO: Put all the logic into a logger block, so it will never be computed at runtime if the log level is too high
         
     | 
| 
       14 
22 
     | 
    
         
             
                        log_prefix = self.class.debug_invocation_to_s(klass: self.class.to_s, separator: "#", method_to_log: method_to_log, config_proxy: config_proxy)
         
     | 
| 
       15 
23 
     | 
    
         
             
                        signature = self.class.debug_signature_to_s(args: args, config_proxy: config_proxy)
         
     | 
| 
       16 
24 
     | 
    
         
             
                        invocation_id = self.class.debug_invocation_id_to_s(args: args, config_proxy: config_proxy)
         
     | 
    
        data/lib/simple_debug_logging.rb
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Simpler version of what the sibling DebugLogging library does.  Included as a bauble.
         
     | 
| 
       2 
2 
     | 
    
         
             
            #
         
     | 
| 
       3 
3 
     | 
    
         
             
            ############# THIS IS A BAUBLE
         
     | 
| 
       4 
     | 
    
         
            -
            ############# FOR  
     | 
| 
      
 4 
     | 
    
         
            +
            ############# FOR EXAMINING SEVERAL OF THE WONDERS OF RUBY
         
     | 
| 
       5 
5 
     | 
    
         
             
            ############# TO ACCOMPLISH SOMETHING PRACTICAL
         
     | 
| 
       6 
6 
     | 
    
         
             
            ############# For a more robust implementation use the gem debug_logging itself, 
         
     | 
| 
       7 
7 
     | 
    
         
             
            #############   which makes use of these same principles.
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: debug_logging
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.0.11
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Peter Boling
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2017- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2017-10-06 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: colorize
         
     |