httplog 0.99.3 → 0.99.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
  SHA1:
3
- metadata.gz: 581879322147032136323a8a982c028e1b1b063e
4
- data.tar.gz: 56ec16deb9eebe33c5e6da3df127e5f8ba09d958
3
+ metadata.gz: b8b854409f6881371b59bc356aaf5ee7b12aebfb
4
+ data.tar.gz: 62a3ee6f6dd01a22402611431fdb10be7de38b41
5
5
  SHA512:
6
- metadata.gz: 70d55fc976c0ce2b3a897d5aee24a2d5b7bc51cd879374f820a2d9911113208552cb76656e7942c734f7683b9098b5946ccc41bc6e60a1823cdbc9d0e3841717
7
- data.tar.gz: 3024c6779bd1ed1461ecc453af2afb408cfe14d4c64f82d519fb530a24a8c75b1e77a7f7570009b29d39b8679a8cabc0a341dd1062b8fe052ef46ac8c075749d
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
- HttpLog.configure do |config|
53
-
54
- # You can assign a different logger
55
- config.logger = Logger.new($stdout)
56
-
57
- # I really wouldn't change this...
58
- config.severity = Logger::Severity::DEBUG
59
-
60
- # Tweak which parts of the HTTP cycle to log...
61
- config.log_connect = true
62
- config.log_request = true
63
- config.log_headers = false
64
- config.log_data = true
65
- config.log_status = true
66
- config.log_response = true
67
- config.log_benchmark = true
68
-
69
- # ...or log all request as a single line by setting this to `true`
70
- config.compact_log = false
71
-
72
- # Prettify the output - see below
73
- config.color = false
74
-
75
- # Limit logging based on URL patterns
76
- config.url_whitelist_pattern = /.*/
77
- config.url_blacklist_pattern = nil
78
- end
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
- # config/environments/development.rb
83
-
84
- HttpLog.configure do |config|
85
- config.logger = Rails.logger
86
- end
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
- HttpLog.configure do |config|
91
- config.color = {color: :black, background: :light_red}
92
- end
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
 
@@ -95,7 +95,7 @@ module HttpLog
95
95
 
96
96
  def log_data(data)
97
97
  return if config.compact_log || !config.log_data
98
- data = utf_encoded(data.to_s)
98
+ data = utf_encoded(data.to_s.dup)
99
99
 
100
100
  if config.prefix_data_lines
101
101
  log("Data:")
@@ -1,4 +1,4 @@
1
1
  module HttpLog
2
- VERSION = "0.99.3"
2
+ VERSION = "0.99.4"
3
3
  end
4
4
 
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.3
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-04-24 00:00:00.000000000 Z
11
+ date: 2017-06-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec