hatchet 0.2.3 → 0.2.5

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: da8ec369eb8d1ee5c73383645ae271e7a8dcbebe
4
- data.tar.gz: 759af45c480c604a4dd042fb9c45f7ae3a5ed91a
3
+ metadata.gz: 1a8f3bba951d0af7880faf8d61eaee4b82e45dd7
4
+ data.tar.gz: 8d295b2641278f9356f3421f99ea0d853006f45a
5
5
  SHA512:
6
- metadata.gz: b290b169776f3dd0c3a2d4b50309db22e6717704470a352da1079236203be4a257f74968b4ccca563fe69b15c173bde641b00d9e43f573dcb0308d04fb88d167
7
- data.tar.gz: 558575545e8205a648dc733f66f7544ab9f62c39b5da4165acba613f25e36101cad3bebf8ce0970781f2214e506cf99cc01cc4556c8967c6847d4fe604e38c31
6
+ metadata.gz: 7ccde4fad36c80d294a94d66beaee715823ff1c8ea716e4863d45490dd78b533d244beb9c0de8a023a050a58455ed0f5651a6228752448c4a93d4329c45776a1
7
+ data.tar.gz: 9510517dcb067265926129e7e6cb5a3df9e3be0f811125f8def4320acc4c0c5cb89bc3442a51b9aa79e3fbc8af3387e9b0c108432ca3f4e99592bb93c396668b
data/RELEASE.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release notes
2
2
 
3
+ ## 0.2.5
4
+
5
+ * Rails 4.0 compatibility
6
+
3
7
  ## 0.2.2
4
8
 
5
9
  * Achieved a [4.0 GPA on Code * Climate](https://codeclimate.com/github/gshutler/hatchet)
@@ -105,7 +105,7 @@ module Hatchet
105
105
  # Returns nothing.
106
106
  #
107
107
  def debug(message = nil, error = nil, &block)
108
- add(:debug, message, error, &block)
108
+ add_to_appenders(:debug, message, error, &block)
109
109
  end
110
110
 
111
111
  # Public: Returns true if any of the appenders will log messages for the
@@ -143,7 +143,7 @@ module Hatchet
143
143
  # Returns nothing.
144
144
  #
145
145
  def info(message = nil, error = nil, &block)
146
- add(:info, message, error, &block)
146
+ add_to_appenders(:info, message, error, &block)
147
147
  end
148
148
 
149
149
  # Public: Returns true if any of the appenders will log messages for the
@@ -181,7 +181,7 @@ module Hatchet
181
181
  # Returns nothing.
182
182
  #
183
183
  def warn(message = nil, error = nil, &block)
184
- add(:warn, message, error, &block)
184
+ add_to_appenders(:warn, message, error, &block)
185
185
  end
186
186
 
187
187
  # Public: Returns true if any of the appenders will log messages for the
@@ -219,7 +219,7 @@ module Hatchet
219
219
  # Returns nothing.
220
220
  #
221
221
  def error(message = nil, error = nil, &block)
222
- add(:error, message, error, &block)
222
+ add_to_appenders(:error, message, error, &block)
223
223
  end
224
224
 
225
225
  # Public: Returns true if any of the appenders will log messages for the
@@ -257,7 +257,7 @@ module Hatchet
257
257
  # Returns nothing.
258
258
  #
259
259
  def fatal(message = nil, error = nil, &block)
260
- add(:fatal, message, error, &block)
260
+ add_to_appenders(:fatal, message, error, &block)
261
261
  end
262
262
 
263
263
  # Public: Returns true if any of the appenders will log messages for the
@@ -295,6 +295,61 @@ module Hatchet
295
295
  @configuration.level level
296
296
  end
297
297
 
298
+ # Public: Returns nil, exists for greater compatibility with things
299
+ # expecting a standard Logger.
300
+ #
301
+ def formatter
302
+ nil
303
+ end
304
+
305
+ # Public: No-op, exists for greater compatibility with things expecting a
306
+ # standard Logger.
307
+ #
308
+ def formatter=(formatter)
309
+ # no-op for Logger protocol compatibility
310
+ end
311
+
312
+ # Public: Adds a message to each appender at the specified level.
313
+ #
314
+ # level - The level of the message. One of, in decreasing order of
315
+ # severity:
316
+ #
317
+ # * Logger::FATAL
318
+ # * Logger::ERROR
319
+ # * Logger::WARN
320
+ # * Logger::INFO
321
+ # * Logger::DEBUG
322
+ # * :fatal
323
+ # * :error
324
+ # * :warn
325
+ # * :info
326
+ # * :debug
327
+ #
328
+ # message - The message that will be logged by an appender when it is
329
+ # configured to log at the given level or lower.
330
+ # block - An optional block which will provide a message when invoked.
331
+ #
332
+ # Writes messages to STDOUT if any appender fails to complete the enabled
333
+ # check or log the message.
334
+ #
335
+ # Also aliased as log.
336
+ #
337
+ # Returns nothing.
338
+ #
339
+ def add(severity, message = nil, progname = nil, &block)
340
+ level = STANDARD_TO_SYMBOL[severity] || severity
341
+ add_to_appenders(level, message, nil, &block)
342
+ end
343
+
344
+ alias log add
345
+
346
+ # Public: No-op, exists for greater compatibility with things expecting a
347
+ # standard Logger.
348
+ #
349
+ def <<(msg)
350
+ nil
351
+ end
352
+
298
353
  private
299
354
 
300
355
  # Private: Adds a message to each appender at the specified level.
@@ -319,7 +374,7 @@ module Hatchet
319
374
  #
320
375
  # Returns nothing.
321
376
  #
322
- def add(level, message, error, &block)
377
+ def add_to_appenders(level, message, error, &block)
323
378
  return unless message or block
324
379
 
325
380
  msg = Message.new(ndc: @ndc.context.clone, message: message, error: error, &block)
@@ -4,6 +4,6 @@ module Hatchet
4
4
 
5
5
  # Public: The version of Hatchet.
6
6
  #
7
- VERSION = '0.2.3'
7
+ VERSION = '0.2.5'
8
8
 
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hatchet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Garry Shutler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-01 00:00:00.000000000 Z
11
+ date: 2013-09-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Logging library that provides the ability to add class/module specific
14
14
  filters
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  version: '0'
73
73
  requirements: []
74
74
  rubyforge_project:
75
- rubygems_version: 2.0.3
75
+ rubygems_version: 2.0.7
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Logging library that provides the ability to add class/module specific filters