logjoy 0.3.0 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 18d7116caaea6d515e1379e012a599cdfc5be1fc380ed049fbe9af0942156aba
4
- data.tar.gz: 68937fd8fcd5e02c5b151dd79693e7fc9282623516b15ce18c8c5eece09134a2
3
+ metadata.gz: 56329a258274b0bd9cfb93908a2c0eabd282d997199df65338754f2bf21553bc
4
+ data.tar.gz: c9f0fe2944b7fd218492a8e71e6381bed4815afef1fd54606b29091a074d095a
5
5
  SHA512:
6
- metadata.gz: c90722446495e9e127bed6a0d90b0dd40f51842e7eaa403645ceda2acc30c31d9c338a088a8a0842345ce7e97c6d73ae7432f741db711694521c692dbc0c17d6
7
- data.tar.gz: 9b4a01ccb3f7c7391eb43ecfff6ee79cd8f63f7e2b8bd62550df474bef719f2eb0ce879565224dfc6c51dcffc5b0d10274362ee00d4e60e7eccdea5971f34b8f
6
+ metadata.gz: 692adfc536f2bd584fe5cbf0c2037f3489d3b874e83d0e8d4dc286c61a4f96a6284beb770d03653f92464b2d881243f3b475ce9e576cd59a2a984fc1ec834034
7
+ data.tar.gz: '09bd6e67e9ce7f7bcf8a026ce93a748a50e96d3cc135b7fffb2493fd970ae37a5ad38a052f240a6b20763bad3f8175e845ab1cf750e9edb0aa9770e027cc68f7'
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'active_support/log_subscriber'
4
- require 'action_controller/base'
5
4
  require 'action_controller/log_subscriber'
6
5
 
7
6
  module Logjoy
@@ -13,7 +12,8 @@ module Logjoy
13
12
  info do
14
13
  payload = event.payload
15
14
 
16
- log = payload.slice(:controller, :action, :format, :method, :path, :status)
15
+ log = payload.slice(:controller, :action, :format, :method, :status)
16
+ log[:path] = strip_query(payload[:path])
17
17
  log[:view_runtime] = rounded_ms(payload[:view_runtime])
18
18
  log[:db_runtime] = rounded_ms(payload[:db_runtime])
19
19
  log[:duration] = rounded_ms(event.duration)
@@ -37,6 +37,11 @@ module Logjoy
37
37
 
38
38
  private
39
39
 
40
+ def strip_query(path_with_query)
41
+ uri = URI.parse(path_with_query)
42
+ uri.path
43
+ end
44
+
40
45
  def ignore_event?(event)
41
46
  Logjoy.filters.include?(event.payload[:path])
42
47
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Logjoy
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.4'
5
5
  end
data/lib/logjoy.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'active_support/core_ext/string/inflections'
3
4
  require 'action_view/log_subscriber'
4
5
  require 'action_controller/log_subscriber'
5
6
  require 'action_mailer/log_subscriber'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logjoy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat McGee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-29 00:00:00.000000000 Z
11
+ date: 2021-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionmailer