blabbermouth-rails 0.1.2 → 0.1.3

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: 3bc9a993952448ec64943da6b24eb8b955ee249e
4
- data.tar.gz: 9ba79c818874adef1cc6439b6ae241eee687f8fd
3
+ metadata.gz: fa7888002186a538b40a4e0980317ec768156938
4
+ data.tar.gz: d720244578affeb1df25e2c6a20f3268b32e6b57
5
5
  SHA512:
6
- metadata.gz: 448fbb15cbf89e965234b6287a0e36874b8f1352b03c90e1e07c96e12f979eb344fcac49f08ca108e76f5dd9f58005d0799d066f59842a3716726a1df3a097ba
7
- data.tar.gz: 4b189ebe6e0e34ebd3442190183f3eedb1de01c3aae8e1f5efa51d0485bba35b9341fed08c7b36389772f2c2bbc0104699dfe889871ef8554064c28095ab249e
6
+ metadata.gz: 30cd0e1be0008bb62ac928c9efb0132192b65f0de91dac5222b4cfe2acd6390e5ab94c2f252fccd47abef492b50a08e8d01249200b8d55a97a177acefbc78763
7
+ data.tar.gz: b78ae99326a970a91a6179acf3b9afa823562276c1d4feaccf8201f75e257bb48643e127a56f51b6d9a30ed14f46095caf93396f952847bdc29e9914f83b9df1
@@ -8,6 +8,18 @@ module Blabbermouth
8
8
  relay :error, key, e, *args
9
9
  end
10
10
 
11
+ def critical(key, e, *args)
12
+ relay :critical, key, e, *args
13
+ end
14
+
15
+ def warning(key, e=nil, *args)
16
+ relay :warning, key, e, *args
17
+ end
18
+
19
+ def debug(key, e=nil, *args)
20
+ relay :debug, key, e, *args
21
+ end
22
+
11
23
  def info(key, msg=nil, *args)
12
24
  relay :info, key, msg, *args
13
25
  end
@@ -33,7 +45,7 @@ module Blabbermouth
33
45
 
34
46
  def log(event, key, msg, data={})
35
47
  message = log_message(event, key, msg, data)
36
- if event == :error
48
+ if [:error, :critical].include?(event)
37
49
  ::Rails.logger.error(message)
38
50
  else
39
51
  ::Rails.logger.info(message)
@@ -14,6 +14,27 @@ RSpec.describe Blabbermouth::Bystanders::Rails do
14
14
  end
15
15
  end
16
16
 
17
+ describe '#critical' do
18
+ it 'uses the rails logger' do
19
+ subject.critical('key', StandardError.new)
20
+ expect(Rails.logger.errors).to include(subject.send(:log_message, :critical, 'key', StandardError.new))
21
+ end
22
+ end
23
+
24
+ describe '#warning' do
25
+ it 'uses the rails logger' do
26
+ subject.warning('key', 'test')
27
+ expect(Rails.logger.infos).to include(subject.send(:log_message, :warning, 'key', 'test'))
28
+ end
29
+ end
30
+
31
+ describe '#debug' do
32
+ it 'uses the rails logger' do
33
+ subject.debug('key', 'test')
34
+ expect(Rails.logger.infos).to include(subject.send(:log_message, :debug, 'key', 'test'))
35
+ end
36
+ end
37
+
17
38
  describe '#info' do
18
39
  it 'uses the rails logger' do
19
40
  subject.info('key', 'test')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blabbermouth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Rebec
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-31 00:00:00.000000000 Z
11
+ date: 2016-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: blabbermouth