httplog 1.3.0 → 1.3.1

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: bd063a60dafd4b6bcc29fa80d877f8bd650375f4633fb0f0bc4398075677b583
4
- data.tar.gz: 136a0fe30f033ad30f8867e327e18109255735b371cc9ab5a7d8e973d3b6e201
3
+ metadata.gz: e4e1ea9c25d6b30a6857ecbf3358e18a5336039ae411b381b33260d9e9b2af01
4
+ data.tar.gz: b7d8d584ad7742092d982b299fcfa4b64bc8d8899be9e854e9df2e185d2a5fb4
5
5
  SHA512:
6
- metadata.gz: d4de29f881f37f1149400324e8c97de77dd7d7ef21e983dd513e411ae4c5b3d67d886807accdfddccbcc388d03e242e4597457d42783525e8ddcf8dbf9064799
7
- data.tar.gz: 46df8a4e8dff1054f60b8545db22df35159c20ee0ab405d78795d476cc990efffd7d8cfe635f7641667d78cbac38fc0d5709ae8e802d040989356a883d3a4cd8
6
+ metadata.gz: 8af022be7a67f8686565e1b989ddfdb7711b5643a647b936731f5bf9e176f3c9b628146c35190f592e617840bdba97df00cd1a84e0017e494de1c70a7acf8cdc
7
+ data.tar.gz: 9d0471b0c8b86705176d96c3ee116ecc0ed7f7aae39d8660acfff51ffa1f0453b63a368dd934e2efac7e28990e94d2720f5c345fecf01458095cf7085bf0d7f3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- httplog (1.3.0)
4
+ httplog (1.3.1)
5
5
  rack (>= 1.0)
6
6
  rainbow (>= 2.0.0)
7
7
 
data/README.md CHANGED
@@ -54,8 +54,9 @@ HttpLog.configure do |config|
54
54
  # Enable or disable all logging
55
55
  config.enabled = true
56
56
 
57
- # You can assign a different logger
57
+ # You can assign a different logger or method to call on that logger
58
58
  config.logger = Logger.new($stdout)
59
+ config.logger_method = :log
59
60
 
60
61
  # I really wouldn't change this...
61
62
  config.severity = Logger::Severity::DEBUG
@@ -97,6 +98,9 @@ HttpLog.configure do |config|
97
98
  end
98
99
  ```
99
100
 
101
+ If you're running a (hopefully patched) legacy Rails 3 app, you may need to set
102
+ `config.logger_method = :add` due to its somewhat unusual logger.
103
+
100
104
  You can colorize the output to make it stand out in your logfile, either with a single color
101
105
  for the text:
102
106
 
@@ -6,6 +6,7 @@ module HttpLog
6
6
  :compact_log,
7
7
  :json_log,
8
8
  :logger,
9
+ :logger_method,
9
10
  :severity,
10
11
  :prefix,
11
12
  :log_connect,
@@ -28,6 +29,7 @@ module HttpLog
28
29
  @compact_log = false
29
30
  @json_log = false
30
31
  @logger = Logger.new($stdout)
32
+ @logger_method = :log
31
33
  @severity = Logger::Severity::DEBUG
32
34
  @prefix = LOG_PREFIX
33
35
  @log_connect = true
@@ -53,7 +53,7 @@ module HttpLog
53
53
  def log(msg)
54
54
  return unless config.enabled
55
55
 
56
- config.logger.log(config.severity, colorize(prefix + msg))
56
+ config.logger.public_send(config.logger_method, config.severity, colorize(prefix + msg))
57
57
  end
58
58
 
59
59
  def log_connection(host, port = nil)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HttpLog
4
- VERSION = '1.3.0'.freeze
4
+ VERSION = '1.3.1'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httplog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thilo Rusche
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-18 00:00:00.000000000 Z
11
+ date: 2019-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ethon