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 +4 -4
- data/lib/nypl_log_formatter.rb +12 -0
- data/lib/nypl_log_formatter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf6587a0533d86c2a63a258ee8bb63c14134079753a420202ff6e22453535394
|
4
|
+
data.tar.gz: 230b6d2da7905e01d43678e91be7b28fe56af489d232701bc3469442a00ddbc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0839a5cb456bc98e8142fc601cf59036055d0c69aaccecd301394369bd06cad597a585751c2d58d2630137060f0ff5ba439c40a3a9aefa897d5c8d8c15c6a9d
|
7
|
+
data.tar.gz: e800c4aab71a9df2b3a7cd33075c786eedbb8ffb5eeb6471f7ae1a230c1936126c1b54b8b51b6b1bff42df7e4f8efbd4210eb2b2ecccadc28b4614d6a93997d6
|
data/lib/nypl_log_formatter.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2018-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|