httplog 1.3.0 → 1.3.1
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 +1 -1
- data/README.md +5 -1
- data/lib/httplog/configuration.rb +2 -0
- data/lib/httplog/http_log.rb +1 -1
- data/lib/httplog/version.rb +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: e4e1ea9c25d6b30a6857ecbf3358e18a5336039ae411b381b33260d9e9b2af01
|
4
|
+
data.tar.gz: b7d8d584ad7742092d982b299fcfa4b64bc8d8899be9e854e9df2e185d2a5fb4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8af022be7a67f8686565e1b989ddfdb7711b5643a647b936731f5bf9e176f3c9b628146c35190f592e617840bdba97df00cd1a84e0017e494de1c70a7acf8cdc
|
7
|
+
data.tar.gz: 9d0471b0c8b86705176d96c3ee116ecc0ed7f7aae39d8660acfff51ffa1f0453b63a368dd934e2efac7e28990e94d2720f5c345fecf01458095cf7085bf0d7f3
|
data/Gemfile.lock
CHANGED
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
|
data/lib/httplog/http_log.rb
CHANGED
@@ -53,7 +53,7 @@ module HttpLog
|
|
53
53
|
def log(msg)
|
54
54
|
return unless config.enabled
|
55
55
|
|
56
|
-
config.logger.
|
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)
|
data/lib/httplog/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ethon
|