heavylog 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/heavylog/version.rb +1 -1
- data/lib/heavylog.rb +7 -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: 055e614a6c0fc73c6621118fb43e559ce1ddda63ea985345b43d489ccde63127
|
4
|
+
data.tar.gz: ca0a8fefe033be2369c50ea8dcd0d97f3d66dc539fb0c2e71599ef35f059c780
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdb4fa0c09407ffa4f677b9f0e732dbfe8f634aef428cd28176a94c31cbdf9f7d00385d1acdc92df8cbb17d0cbb55cfff749b1c86ffd8db8b1d3abb9cc92b442
|
7
|
+
data.tar.gz: 17e1f87ecb6bcc5bbea21f052806c0a7d2d0d24ed3e0f1f850ac70aaeb70310fea97993a96729effcd3a494eba926ab1cf7c476e803470789503c14c25250aa8
|
data/lib/heavylog/version.rb
CHANGED
data/lib/heavylog.rb
CHANGED
@@ -76,7 +76,7 @@ module Heavylog
|
|
76
76
|
|
77
77
|
RequestStore.store[:heavylog_buffer] ||= StringIO.new
|
78
78
|
|
79
|
-
if RequestStore.store[:heavylog_buffer].length + message
|
79
|
+
if RequestStore.store[:heavylog_buffer].length + message_size(message) > config.message_limit
|
80
80
|
RequestStore.store[:heavylog_buffer].truncate(0)
|
81
81
|
RequestStore.store[:heavylog_buffer].puts(TRUNCATION)
|
82
82
|
RequestStore.store[:heavylog_truncated] = true
|
@@ -106,6 +106,12 @@ module Heavylog
|
|
106
106
|
return OrderedOptions.new if !application
|
107
107
|
application.config.heavylog
|
108
108
|
end
|
109
|
+
|
110
|
+
def message_size(message)
|
111
|
+
return message.bytesize if message.respond_to?(:bytesize)
|
112
|
+
return message.map(&:to_s).sum(&:bytesize) if message.is_a?(Array)
|
113
|
+
message.length
|
114
|
+
end
|
109
115
|
end
|
110
116
|
|
111
117
|
require 'heavylog/railtie' if defined?(Rails)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heavylog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristjan Rang
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-06-
|
11
|
+
date: 2018-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|