steno 1.2.2-x86-mingw32 → 1.2.4-x86-mingw32

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWRiYjNmNzE4ZTlhNTJhMDAzZTJkZTRjYjQ4NTk4NTA4NjFiMDQ2ZA==
4
+ OTI3NDA4ZGUxNmIzYTE4MDk3YzM2N2Q3ZWU1YjMyZDQ2YzkxM2YyZQ==
5
5
  data.tar.gz: !binary |-
6
- OWQ2NGFhNjk0YTg5MzBlM2NlMGE4NDU4YTAxOTc0ODRiYzAwNTdjNw==
7
- !binary "U0hBNTEy":
6
+ MmEyMWQwMDI2MWRkODlmYjRjNzRhNDNjYWY1NWRkNWI3MmM5YTBlYw==
7
+ SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTJmYTA0N2ViOTNkNTkzZjZlZTg0MDUzODlmMzljNzQxMmY1Y2JkN2UzYzQ1
10
- N2FlNjU3MjAwNGFhNGVhZTNlMjI5YTlkMmZiYTRlN2EyNzkzMTM5MmQ2ODQy
11
- MGI3YWZlOTUwMThkNTJiOTUzN2RiY2M4ZWVjYzkyOWMyYzA1ZTQ=
9
+ Y2VlNGZiNTYwMGI1MGNkODI3MGViNjQxY2ZjNThkZWFkYzc2OGQxODBjYjQ0
10
+ ZjcwNTllMmIwYTM5ZGQyZDQzZDUzYWMwZDY5M2UxMmU5MGY4NzNhMTIwOTRk
11
+ MTk2NTVhN2I3MWFkZTg1YmE4NDUzNGI3NjE1YmYyNjcyZGEzZGM=
12
12
  data.tar.gz: !binary |-
13
- N2EyZTY2YzMxZTQ1NjVmYWRkY2RmMDVlZmU0NTIwNmFiOTk2YTAxN2U4ZTli
14
- NDkxMDAxYmFjNWM5Y2M5MmZjY2RjOTI1MTUyZDIzYzVkMjM2ZWMxZWRkNzll
15
- MjJmZTFiNmMwMjQ5YTRkZDVlZWNmZDJkNjllNjUzZjVhNDEzZDU=
13
+ ZTQ4ZmRjY2Q5NTYxY2M0MmM4NzdiZTU0NDlkM2MyMmJjZDNiMTQ3MTA2ZDYx
14
+ OTJlOGQ4YjZjY2JhZTk5YWQxYzQ1MzQ2ZjdlNzFiODA0N2I2MTY2OWE3NWFl
15
+ MTM5MGJiMWFjMjliNDQ1YTAzYjFkNDBjNDhmNmE3MDVlYzY4MDQ=
@@ -9,13 +9,13 @@ if Steno::Sink::WINDOWS
9
9
  include Singleton
10
10
 
11
11
  LOG_LEVEL_MAP = {
12
- :fatal => Win32::EventLog::ERROR,
13
- :error => Win32::EventLog::ERROR,
14
- :warn => Win32::EventLog::WARN,
15
- :info => Win32::EventLog::INFO,
16
- :debug => Win32::EventLog::INFO,
17
- :debug1 => Win32::EventLog::INFO,
18
- :debug2 => Win32::EventLog::INFO,
12
+ :fatal => Win32::EventLog::ERROR_TYPE,
13
+ :error => Win32::EventLog::ERROR_TYPE,
14
+ :warn => Win32::EventLog::WARN_TYPE,
15
+ :info => Win32::EventLog::INFO_TYPE,
16
+ :debug => Win32::EventLog::INFO_TYPE,
17
+ :debug1 => Win32::EventLog::INFO_TYPE,
18
+ :debug2 => Win32::EventLog::INFO_TYPE,
19
19
  }
20
20
 
21
21
  def initialize
@@ -9,6 +9,7 @@ unless Steno::Sink::WINDOWS
9
9
  include Singleton
10
10
 
11
11
  MAX_MESSAGE_SIZE = 1024 * 3
12
+ TRUNCATE_POSTFIX = "..."
12
13
 
13
14
  LOG_LEVEL_MAP = {
14
15
  :fatal => Syslog::LOG_CRIT,
@@ -48,8 +49,8 @@ unless Steno::Sink::WINDOWS
48
49
  def truncate_record(record)
49
50
  return record if record.message.size <= MAX_MESSAGE_SIZE
50
51
 
51
- truncated = record.message.slice(0..(MAX_MESSAGE_SIZE - 1))
52
- truncated << "..."
52
+ truncated = record.message.slice(0...(MAX_MESSAGE_SIZE - TRUNCATE_POSTFIX.size))
53
+ truncated << TRUNCATE_POSTFIX
53
54
  Steno::Record.new(record.source, record.log_level,
54
55
  truncated,
55
56
  [record.file, record.lineno, record.method],
data/lib/steno/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Steno
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.4"
3
3
  end
@@ -25,7 +25,7 @@ if Steno::Sink::WINDOWS
25
25
  sink.codec = codec
26
26
 
27
27
  eventlog.should_receive(:report_event).with(:source => "CloudFoundry",
28
- :event_type => Win32::EventLog::INFO,
28
+ :event_type => Win32::EventLog::INFO_TYPE,
29
29
  :data => record.message)
30
30
 
31
31
  sink.add_record(record)
@@ -47,12 +47,13 @@ unless Steno::Sink::WINDOWS
47
47
  sink.open(identity)
48
48
 
49
49
  truncated = record_with_big_message.message.
50
- slice(0..(Steno::Sink::Syslog::MAX_MESSAGE_SIZE) - 1)
51
- truncated << "..."
50
+ slice(0..(Steno::Sink::Syslog::MAX_MESSAGE_SIZE) - 4)
51
+ truncated << Steno::Sink::Syslog::TRUNCATE_POSTFIX
52
52
  codec = double("codec")
53
53
  codec.should_receive(:encode_record) do |*args|
54
54
  args.size.should == 1
55
55
  args[0].message.should == truncated
56
+ args[0].message.size.should <= Steno::Sink::Syslog::MAX_MESSAGE_SIZE
56
57
 
57
58
  next args[0].message
58
59
  end
data/steno.gemspec CHANGED
@@ -25,7 +25,6 @@ Gem::Specification.new do |gem|
25
25
  gem.require_paths = ["lib"]
26
26
  gem.version = Steno::VERSION
27
27
 
28
- gem.add_dependency("grape")
29
28
  gem.add_dependency("yajl-ruby", "~> 1.0")
30
29
  gem.add_dependency("fluent-logger")
31
30
 
@@ -36,6 +35,6 @@ Gem::Specification.new do |gem|
36
35
 
37
36
  if RUBY_PLATFORM=~ /mswin|mingw|cygwin/
38
37
  gem.platform = Gem::Platform::CURRENT
39
- gem.add_dependency("win32-eventlog")
38
+ gem.add_dependency("win32-eventlog", "~> 0.6.0")
40
39
  end
41
40
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: steno
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.4
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - mpage
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-06 00:00:00.000000000 Z
11
+ date: 2014-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: grape
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ! '>='
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :runtime
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ! '>='
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: yajl-ruby
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -112,16 +98,16 @@ dependencies:
112
98
  name: win32-eventlog
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
- - - ! '>='
101
+ - - ~>
116
102
  - !ruby/object:Gem::Version
117
- version: '0'
103
+ version: 0.6.0
118
104
  type: :runtime
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
- - - ! '>='
108
+ - - ~>
123
109
  - !ruby/object:Gem::Version
124
- version: '0'
110
+ version: 0.6.0
125
111
  description: A thread-safe logging library designed to support multiple log destinations.
126
112
  email:
127
113
  - mpage@rbcon.com
@@ -130,32 +116,31 @@ executables:
130
116
  extensions: []
131
117
  extra_rdoc_files: []
132
118
  files:
119
+ - LICENSE
120
+ - README.md
121
+ - Rakefile
133
122
  - bin/steno-prettify
123
+ - lib/steno.rb
124
+ - lib/steno/codec.rb
134
125
  - lib/steno/codec/base.rb
135
126
  - lib/steno/codec/json.rb
136
- - lib/steno/codec.rb
137
127
  - lib/steno/config.rb
138
128
  - lib/steno/context.rb
139
129
  - lib/steno/core_ext.rb
140
130
  - lib/steno/errors.rb
141
- - lib/steno/http_handler.rb
142
131
  - lib/steno/json_prettifier.rb
143
- - lib/steno/logger.rb
144
132
  - lib/steno/log_level.rb
133
+ - lib/steno/logger.rb
145
134
  - lib/steno/record.rb
135
+ - lib/steno/sink.rb
146
136
  - lib/steno/sink/base.rb
147
137
  - lib/steno/sink/counter.rb
148
138
  - lib/steno/sink/eventlog.rb
149
139
  - lib/steno/sink/fluentd.rb
150
140
  - lib/steno/sink/io.rb
151
141
  - lib/steno/sink/syslog.rb
152
- - lib/steno/sink.rb
153
142
  - lib/steno/tagged_logger.rb
154
143
  - lib/steno/version.rb
155
- - lib/steno.rb
156
- - LICENSE
157
- - Rakefile
158
- - README.md
159
144
  - spec/spec_helper.rb
160
145
  - spec/support/barrier.rb
161
146
  - spec/support/null_sink.rb
@@ -163,11 +148,10 @@ files:
163
148
  - spec/unit/config_spec.rb
164
149
  - spec/unit/context_spec.rb
165
150
  - spec/unit/core_ext_spec.rb
166
- - spec/unit/http_handler_spec.rb
167
151
  - spec/unit/json_codec_spec.rb
168
152
  - spec/unit/json_prettifier_spec.rb
169
- - spec/unit/logger_spec.rb
170
153
  - spec/unit/log_level_spec.rb
154
+ - spec/unit/logger_spec.rb
171
155
  - spec/unit/record_spec.rb
172
156
  - spec/unit/sink/counter_spec.rb
173
157
  - spec/unit/sink/eventlog_spec.rb
@@ -176,7 +160,6 @@ files:
176
160
  - spec/unit/sink/syslog_spec.rb
177
161
  - spec/unit/steno_spec.rb
178
162
  - spec/unit/tagged_logger_spec.rb
179
- - steno-1.2.1.gem
180
163
  - steno.gemspec
181
164
  homepage: http://www.cloudfoundry.org
182
165
  licenses: []
@@ -197,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
180
  version: '0'
198
181
  requirements: []
199
182
  rubyforge_project:
200
- rubygems_version: 2.0.7
183
+ rubygems_version: 2.2.1
201
184
  signing_key:
202
185
  specification_version: 4
203
186
  summary: A logging library.
@@ -209,11 +192,10 @@ test_files:
209
192
  - spec/unit/config_spec.rb
210
193
  - spec/unit/context_spec.rb
211
194
  - spec/unit/core_ext_spec.rb
212
- - spec/unit/http_handler_spec.rb
213
195
  - spec/unit/json_codec_spec.rb
214
196
  - spec/unit/json_prettifier_spec.rb
215
- - spec/unit/logger_spec.rb
216
197
  - spec/unit/log_level_spec.rb
198
+ - spec/unit/logger_spec.rb
217
199
  - spec/unit/record_spec.rb
218
200
  - spec/unit/sink/counter_spec.rb
219
201
  - spec/unit/sink/eventlog_spec.rb
@@ -222,3 +204,4 @@ test_files:
222
204
  - spec/unit/sink/syslog_spec.rb
223
205
  - spec/unit/steno_spec.rb
224
206
  - spec/unit/tagged_logger_spec.rb
207
+ has_rdoc:
@@ -1,41 +0,0 @@
1
- require "steno"
2
-
3
- require "grape"
4
-
5
- module Steno
6
- end
7
-
8
- class Steno::HttpHandler < Grape::API
9
- format :json
10
-
11
- resource :loggers do
12
- get :levels do
13
- Steno.logger_level_snapshot
14
- end
15
-
16
- put :levels do
17
- missing = [:regexp, :level].select { |p| !params.key?(p) }.map(&:to_s)
18
-
19
- if !missing.empty?
20
- error!("Missing query parameters: #{missing}", 400)
21
- end
22
-
23
- regexp = nil
24
- begin
25
- regexp = Regexp.new(params[:regexp])
26
- rescue => e
27
- error!("Invalid regexp", 400)
28
- end
29
-
30
- level = params[:level].to_sym
31
- if !Steno::Logger::LEVELS.key?(level)
32
- levels = Steno::Logger::LEVELS.keys.map(&:to_s)
33
- error!("Unknown level: #{level}. Supported levels are: #{levels}", 400)
34
- end
35
-
36
- Steno.set_logger_regexp(regexp, level)
37
-
38
- "ok"
39
- end
40
- end
41
- end
@@ -1,73 +0,0 @@
1
- require "spec_helper"
2
-
3
- require "steno/http_handler"
4
-
5
- describe Steno::HttpHandler do
6
- include Rack::Test::Methods
7
-
8
- let(:config) { Steno::Config.new }
9
-
10
- before :each do
11
- Steno.init(config)
12
- end
13
-
14
- def app
15
- Steno::HttpHandler
16
- end
17
-
18
- describe "GET /loggers/levels" do
19
- it "returns a hash of logger name to level" do
20
- get "/loggers/levels"
21
- json_body.should == {}
22
-
23
- foo = Steno.logger("foo")
24
- foo.level = :debug
25
-
26
- bar = Steno.logger("bar")
27
- bar.level = :info
28
-
29
- get "/loggers/levels"
30
- json_body.should == { "foo" => "debug", "bar" => "info" }
31
- end
32
- end
33
-
34
- describe "PUT /loggers/levels" do
35
- it "returns an error on missing parameters" do
36
- put "/loggers/levels"
37
- last_response.status.should == 400
38
- json_body["error"].should match(/Missing query parameters/)
39
-
40
- put "/loggers/levels", :regexp => "hi"
41
- last_response.status.should == 400
42
- json_body["error"].should match(/Missing query parameters/)
43
-
44
- put "/loggers/levels", :level => "debug"
45
- last_response.status.should == 400
46
- json_body["error"].should match(/Missing query parameters/)
47
- end
48
-
49
- it "returns an error on invalid log levels" do
50
- put "/loggers/levels", :regexp => "hi", :level => "foobar"
51
- last_response.status.should == 400
52
- json_body["error"].should match(/Unknown level/)
53
- end
54
-
55
- it "updates log levels for loggers whose name matches the regexp" do
56
- foo = Steno.logger("foo")
57
- foo.level = :debug
58
-
59
- bar = Steno.logger("bar")
60
- bar.level = :warn
61
-
62
- put "/loggers/levels", :regexp => "f", :level => "error"
63
- last_response.status.should == 200
64
-
65
- foo.level.should == :error
66
- bar.level.should == :warn
67
- end
68
- end
69
-
70
- def json_body
71
- Yajl::Parser.parse(last_response.body)
72
- end
73
- end
data/steno-1.2.1.gem DELETED
Binary file