httplog 0.99.3 → 0.99.4
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 +41 -35
- 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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8b854409f6881371b59bc356aaf5ee7b12aebfb
|
4
|
+
data.tar.gz: 62a3ee6f6dd01a22402611431fdb10be7de38b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68f468853efd17748b32a35765132e312677c8bd63246ce60bee3c1a4332d2e9f69b9518816a47f41a3693d334886384ea3d9b541ce8b07b9259bd0cc88335ff
|
7
|
+
data.tar.gz: 3996a486bee5ddb0f9429e5c15d7106e2d2a47cc0fec0716571bdc1393b19c4cde3cd2e9082ba50b350e04147c94ea50d04271e8616e737ec9e1bfc808c54de6
|
data/README.md
CHANGED
@@ -49,47 +49,53 @@ By default, this will log all outgoing HTTP requests and their responses to $std
|
|
49
49
|
|
50
50
|
You can override the following default options:
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
52
|
+
```ruby
|
53
|
+
HttpLog.configure do |config|
|
54
|
+
|
55
|
+
# You can assign a different logger
|
56
|
+
config.logger = Logger.new($stdout)
|
57
|
+
|
58
|
+
# I really wouldn't change this...
|
59
|
+
config.severity = Logger::Severity::DEBUG
|
60
|
+
|
61
|
+
# Tweak which parts of the HTTP cycle to log...
|
62
|
+
config.log_connect = true
|
63
|
+
config.log_request = true
|
64
|
+
config.log_headers = false
|
65
|
+
config.log_data = true
|
66
|
+
config.log_status = true
|
67
|
+
config.log_response = true
|
68
|
+
config.log_benchmark = true
|
69
|
+
|
70
|
+
# ...or log all request as a single line by setting this to `true`
|
71
|
+
config.compact_log = false
|
72
|
+
|
73
|
+
# Prettify the output - see below
|
74
|
+
config.color = false
|
75
|
+
|
76
|
+
# Limit logging based on URL patterns
|
77
|
+
config.url_whitelist_pattern = /.*/
|
78
|
+
config.url_blacklist_pattern = nil
|
79
|
+
end
|
80
|
+
```
|
79
81
|
|
80
82
|
If you want to use this in a Rails app, I'd suggest configuring this specifically for each environment. A global initializer is not a good idea since `HttpLog` will be undefined in production. Because you're **not using this in production**, right? :)
|
81
83
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
84
|
+
```ruby
|
85
|
+
# config/environments/development.rb
|
86
|
+
|
87
|
+
HttpLog.configure do |config|
|
88
|
+
config.logger = Rails.logger
|
89
|
+
end
|
90
|
+
```
|
87
91
|
|
88
92
|
You can colorize the output to make it stand out in your logfile:
|
89
93
|
|
90
|
-
|
91
|
-
|
92
|
-
|
94
|
+
```ruby
|
95
|
+
HttpLog.configure do |config|
|
96
|
+
config.color = {color: :black, background: :light_red}
|
97
|
+
end
|
98
|
+
```
|
93
99
|
|
94
100
|
For more color options [please refer to the colorize documentation](https://github.com/fazibear/colorize/blob/master/README.md)
|
95
101
|
|
data/lib/httplog/http_log.rb
CHANGED
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: 0.99.
|
4
|
+
version: 0.99.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thilo Rusche
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|