rails_log_parser 0.0.11 → 0.0.13
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/Gemfile.lock +9 -9
- data/README.md +8 -0
- data/lib/rails_log_parser/action.rb +3 -2
- data/lib/rails_log_parser/line.rb +4 -1
- data/lib/rails_log_parser/parser.rb +7 -1
- data/rails_log_parser.gemspec +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 956620c0619001e7b37a81dc6d29833e299a3c94f95dba614a543c676f2d5caf
         | 
| 4 | 
            +
              data.tar.gz: 70a3a3694cbd9092929269116f11fd65e9136e25a3dfd29754a5a5a86ec26577
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 11b66b1ee80038c9c9a717167fea4255687bcec4db10787c35efbccd39984f36c1d57727245eb08ef5d4b8540f92dcbb36c0be3d993f8d2b8df6ff086cb8c887
         | 
| 7 | 
            +
              data.tar.gz: 8c3e58120bfb3cae68d42d7f7593f03266b0f9ac3e0ed56b5ae4dd95a6881c8b51eb426e361aedd2485dbc0d6d2528179a1d227dc6b4ab850f62cc85d9d0088b
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,27 +1,27 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                rails_log_parser (0.0. | 
| 4 | 
            +
                rails_log_parser (0.0.13)
         | 
| 5 5 | 
             
                  enumerize (~> 2.4)
         | 
| 6 6 | 
             
                  json (>= 2.0)
         | 
| 7 7 |  | 
| 8 8 | 
             
            GEM
         | 
| 9 9 | 
             
              remote: https://rubygems.org/
         | 
| 10 10 | 
             
              specs:
         | 
| 11 | 
            -
                activesupport (6.1. | 
| 11 | 
            +
                activesupport (6.1.7.3)
         | 
| 12 12 | 
             
                  concurrent-ruby (~> 1.0, >= 1.0.2)
         | 
| 13 13 | 
             
                  i18n (>= 1.6, < 2)
         | 
| 14 14 | 
             
                  minitest (>= 5.1)
         | 
| 15 15 | 
             
                  tzinfo (~> 2.0)
         | 
| 16 16 | 
             
                  zeitwerk (~> 2.3)
         | 
| 17 | 
            -
                concurrent-ruby (1. | 
| 17 | 
            +
                concurrent-ruby (1.2.2)
         | 
| 18 18 | 
             
                diff-lcs (1.4.4)
         | 
| 19 19 | 
             
                enumerize (2.5.0)
         | 
| 20 20 | 
             
                  activesupport (>= 3.2)
         | 
| 21 | 
            -
                i18n (1. | 
| 21 | 
            +
                i18n (1.12.0)
         | 
| 22 22 | 
             
                  concurrent-ruby (~> 1.0)
         | 
| 23 | 
            -
                json (2.6. | 
| 24 | 
            -
                minitest (5. | 
| 23 | 
            +
                json (2.6.3)
         | 
| 24 | 
            +
                minitest (5.18.0)
         | 
| 25 25 | 
             
                rake (12.3.3)
         | 
| 26 26 | 
             
                rspec (3.10.0)
         | 
| 27 27 | 
             
                  rspec-core (~> 3.10.0)
         | 
| @@ -36,9 +36,9 @@ GEM | |
| 36 36 | 
             
                  diff-lcs (>= 1.2.0, < 2.0)
         | 
| 37 37 | 
             
                  rspec-support (~> 3.10.0)
         | 
| 38 38 | 
             
                rspec-support (3.10.3)
         | 
| 39 | 
            -
                tzinfo (2.0. | 
| 39 | 
            +
                tzinfo (2.0.6)
         | 
| 40 40 | 
             
                  concurrent-ruby (~> 1.0)
         | 
| 41 | 
            -
                zeitwerk (2. | 
| 41 | 
            +
                zeitwerk (2.6.7)
         | 
| 42 42 |  | 
| 43 43 | 
             
            PLATFORMS
         | 
| 44 44 | 
             
              ruby
         | 
| @@ -49,4 +49,4 @@ DEPENDENCIES | |
| 49 49 | 
             
              rspec (~> 3.0)
         | 
| 50 50 |  | 
| 51 51 | 
             
            BUNDLED WITH
         | 
| 52 | 
            -
               2. | 
| 52 | 
            +
               2.3.26
         | 
    
        data/README.md
    CHANGED
    
    | @@ -49,6 +49,14 @@ print parser.summary(last_minutes: 22)          # print summary for the last 22 | |
| 49 49 |  | 
| 50 50 | 
             
            ## Changelog
         | 
| 51 51 |  | 
| 52 | 
            +
            ### 0.0.13
         | 
| 53 | 
            +
             | 
| 54 | 
            +
            * Better empty lines handling
         | 
| 55 | 
            +
             | 
| 56 | 
            +
            ### 0.0.12
         | 
| 57 | 
            +
             | 
| 58 | 
            +
            * Adding `ActionController::UnknownFormat` as known exceptions
         | 
| 59 | 
            +
             | 
| 52 60 | 
             
            ### 0.0.11
         | 
| 53 61 |  | 
| 54 62 | 
             
            * Increase minimum requests value for heuristic
         | 
| @@ -10,11 +10,12 @@ class RailsLogParser::Action | |
| 10 10 |  | 
| 11 11 | 
             
              SEVERITIES = %i[debug info warn error fatal].freeze
         | 
| 12 12 | 
             
              KNOWN_EXCEPTIONS = {
         | 
| 13 | 
            -
                'ActiveRecord::RecordNotFound' => :fatal,
         | 
| 14 | 
            -
                'ActionController::RoutingError' => :fatal,
         | 
| 15 13 | 
             
                "Can't verify CSRF token authenticity." => :warn,
         | 
| 16 14 | 
             
                'ActionController::InvalidAuthenticityToken' => :fatal,
         | 
| 15 | 
            +
                'ActionController::RoutingError' => :fatal,
         | 
| 17 16 | 
             
                'ActionController::UnfilteredParameters' => :fatal,
         | 
| 17 | 
            +
                'ActionController::UnknownFormat' => :fatal,
         | 
| 18 | 
            +
                'ActiveRecord::RecordNotFound' => :fatal,
         | 
| 18 19 | 
             
              }.freeze
         | 
| 19 20 |  | 
| 20 21 | 
             
              extend Enumerize
         | 
| @@ -20,7 +20,10 @@ class RailsLogParser::Line | |
| 20 20 | 
             
                  (?<severity_label>[A-Z]+)\s+--\s+[^:]*:\s+    # INFO -- :
         | 
| 21 21 | 
             
                  \[(?<id>[a-f0-9\-]{36})\]\s*                  # [b42b65ab-7985-4bc2-a5b5-1fb23e6ad940]
         | 
| 22 22 | 
             
                  \z/x)
         | 
| 23 | 
            -
                 | 
| 23 | 
            +
                if match
         | 
| 24 | 
            +
                  parser.empty_line(match)
         | 
| 25 | 
            +
                  return
         | 
| 26 | 
            +
                end
         | 
| 24 27 |  | 
| 25 28 | 
             
                # normal log line
         | 
| 26 29 | 
             
                match = line.match(/
         | 
| @@ -79,13 +79,19 @@ class RailsLogParser::Parser | |
| 79 79 | 
             
                @actions[params['id']] ||= RailsLogParser::Action.new(type, params['id'])
         | 
| 80 80 | 
             
                @actions[params['id']].severity = params['severity_label']
         | 
| 81 81 | 
             
                @actions[params['id']].datetime = params['datetime']
         | 
| 82 | 
            -
                @actions[params['id']].add_message(params['message'])
         | 
| 82 | 
            +
                @actions[params['id']].add_message(params['message']) unless params['message'].nil?
         | 
| 83 83 | 
             
              end
         | 
| 84 84 |  | 
| 85 85 | 
             
              def request(params)
         | 
| 86 86 | 
             
                action(:request, params)
         | 
| 87 87 | 
             
              end
         | 
| 88 88 |  | 
| 89 | 
            +
              def empty_line(params)
         | 
| 90 | 
            +
                params = params.named_captures
         | 
| 91 | 
            +
                params['message'] = nil
         | 
| 92 | 
            +
                action(:request, params)
         | 
| 93 | 
            +
              end
         | 
| 94 | 
            +
             | 
| 89 95 | 
             
              def without_request(params)
         | 
| 90 96 | 
             
                params = params.named_captures
         | 
| 91 97 | 
             
                params['id'] = SecureRandom.uuid
         | 
    
        data/rails_log_parser.gemspec
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rails_log_parser
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.13
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Georg Limbach
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2023-03-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: enumerize
         |