nypl_log_formatter 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
  SHA256:
3
- metadata.gz: cd40e2cd4eb74fc6ced36167ddbae1cdf7311d63ee7eefde5339eb49de30fb04
4
- data.tar.gz: a8851f466ec347427d1f351eef57731fc9cc06055fa0bfe3421af9af961d902f
3
+ metadata.gz: bf6587a0533d86c2a63a258ee8bb63c14134079753a420202ff6e22453535394
4
+ data.tar.gz: 230b6d2da7905e01d43678e91be7b28fe56af489d232701bc3469442a00ddbc9
5
5
  SHA512:
6
- metadata.gz: d727480ed486f211fcd0f6997f054fce95bb97ed7cf8c3c2eb3434384310f8903573fcb4b7d2030c2381a3af85a1f0b9b39f9a1f4bb30781d60ced7957697e2b
7
- data.tar.gz: 63beecc9f84b35a4afae85177ed9e709fc7ebbe1e8255c79604a7632d27fa2359e29d3931d612b4aaddc0404caee9d07b3ec3c43f1710175b7f9cea1509b7d0c
6
+ metadata.gz: c0839a5cb456bc98e8142fc601cf59036055d0c69aaccecd301394369bd06cad597a585751c2d58d2630137060f0ff5ba439c40a3a9aefa897d5c8d8c15c6a9d
7
+ data.tar.gz: e800c4aab71a9df2b3a7cd33075c786eedbb8ffb5eeb6471f7ae1a230c1936126c1b54b8b51b6b1bff42df7e4f8efbd4210eb2b2ecccadc28b4614d6a93997d6
@@ -13,6 +13,18 @@ class NyplLogFormatter < ::Logger
13
13
  allow_arbitrary_keys
14
14
  end
15
15
 
16
+ def silence(temporary_level = NyplLogFormatter::ERROR)
17
+ old_local_level = self.level
18
+ begin
19
+ self.level = temporary_level
20
+ yield self
21
+ rescue Exception
22
+ self.level = old_local_level
23
+ ensure
24
+ self.level = old_local_level
25
+ end
26
+ end
27
+
16
28
  private
17
29
 
18
30
  # Redefines #log(), #error(), etc...but explodes the `progname` arg
@@ -1,3 +1,3 @@
1
1
  module NyplLogFormatterVersion
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nypl_log_formatter
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
  - nodanaonlyzuul
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-08 00:00:00.000000000 Z
11
+ date: 2018-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry