steno 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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[timestamp source process_id thread_id fiber_id location data
11
- log_level message]
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
@@ -1,3 +1,3 @@
1
1
  module Steno
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
@@ -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.2
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: 2012-10-22 00:00:00.000000000 Z
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