steno 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/steno/json_prettifier.rb +16 -3
- data/lib/steno/version.rb +1 -1
- data/spec/unit/json_prettifier_spec.rb +5 -0
- metadata +2 -4
- data/steno-1.0.1.gem +0 -0
@@ -5,10 +5,19 @@ require "yajl"
|
|
5
5
|
module Steno
|
6
6
|
end
|
7
7
|
|
8
|
-
# Transforms JSON log lines into a more human readable format
|
9
8
|
class Steno::JsonPrettifier
|
10
|
-
FIELD_ORDER = %w[
|
11
|
-
|
9
|
+
FIELD_ORDER = %w[
|
10
|
+
timestamp
|
11
|
+
source
|
12
|
+
process_id
|
13
|
+
thread_id
|
14
|
+
fiber_id
|
15
|
+
location
|
16
|
+
data
|
17
|
+
log_level
|
18
|
+
message
|
19
|
+
]
|
20
|
+
|
12
21
|
MIN_COL_WIDTH = 14
|
13
22
|
|
14
23
|
class ParseError < StandardError
|
@@ -98,6 +107,10 @@ class Steno::JsonPrettifier
|
|
98
107
|
"%s/%s:%s" % [trimmed_filename, record["method"], record["lineno"]]
|
99
108
|
end
|
100
109
|
|
110
|
+
def check_data(record)
|
111
|
+
record["data"].is_a?(Hash)
|
112
|
+
end
|
113
|
+
|
101
114
|
def format_data(record)
|
102
115
|
record["data"].map { |k, v| "#{k}=#{v}" }.join(",")
|
103
116
|
end
|
data/lib/steno/version.rb
CHANGED
@@ -75,5 +75,10 @@ describe Steno::JsonPrettifier do
|
|
75
75
|
prettifier.prettify_line("blah")
|
76
76
|
}.to raise_error(Steno::JsonPrettifier::ParseError)
|
77
77
|
end
|
78
|
+
|
79
|
+
it "should work with a nil data field" do
|
80
|
+
line = prettifier.prettify_line(%@{"data":null}@)
|
81
|
+
line.should include(" - ")
|
82
|
+
end
|
78
83
|
end
|
79
84
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: steno
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-02-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: grape
|
@@ -155,7 +155,6 @@ files:
|
|
155
155
|
- spec/unit/sink/syslog_spec.rb
|
156
156
|
- spec/unit/steno_spec.rb
|
157
157
|
- spec/unit/tagged_logger_spec.rb
|
158
|
-
- steno-1.0.1.gem
|
159
158
|
- steno.gemspec
|
160
159
|
homepage: http://www.cloudfoundry.org
|
161
160
|
licenses: []
|
@@ -199,4 +198,3 @@ test_files:
|
|
199
198
|
- spec/unit/sink/syslog_spec.rb
|
200
199
|
- spec/unit/steno_spec.rb
|
201
200
|
- spec/unit/tagged_logger_spec.rb
|
202
|
-
has_rdoc:
|
data/steno-1.0.1.gem
DELETED
Binary file
|