klogger-logger 1.2.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/klogger/group_set.rb +12 -0
- data/lib/klogger/logger.rb +5 -1
- data/lib/klogger.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05fcc83ebb5b6dcc9d947576d52b6d14ddd47c89de9ccfbe361df9dc1f9f33ed
|
4
|
+
data.tar.gz: f3f0d69f3427200dc9bbc74dee90f7dc8ad63aeb1364d8a47ec4c81e463189fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7e688edcf1a9454b422b9aefa6e687298b133a7f847b5c2f6dd0717a1afae395dd83ff68b639a238256e7f1a70f130ae5de18c779cbe6ac3f7c53f824631558
|
7
|
+
data.tar.gz: 77a325bb4eada003e7bfd46a47ec662db1436a4d85c9e12ce2da6bd7a1d5a8ba6d7bbe8ea5f79d73dbadff1baa6adebc1e968bbdc06da2f11e47bcd0b74e235b
|
data/lib/klogger/group_set.rb
CHANGED
@@ -13,6 +13,13 @@ module Klogger
|
|
13
13
|
@groups.value
|
14
14
|
end
|
15
15
|
|
16
|
+
def call_without_id(**tags)
|
17
|
+
add_without_id(**tags)
|
18
|
+
yield
|
19
|
+
ensure
|
20
|
+
pop
|
21
|
+
end
|
22
|
+
|
16
23
|
def call(**tags)
|
17
24
|
add(**tags)
|
18
25
|
yield
|
@@ -26,6 +33,11 @@ module Klogger
|
|
26
33
|
id
|
27
34
|
end
|
28
35
|
|
36
|
+
def add_without_id(**tags)
|
37
|
+
@groups.value += [{ tags: tags }]
|
38
|
+
nil
|
39
|
+
end
|
40
|
+
|
29
41
|
def pop
|
30
42
|
@groups.value.pop
|
31
43
|
end
|
data/lib/klogger/logger.rb
CHANGED
@@ -59,6 +59,10 @@ module Klogger
|
|
59
59
|
@group_set.pop
|
60
60
|
end
|
61
61
|
|
62
|
+
def tagged(**tags, &block)
|
63
|
+
@group_set.call_without_id(**tags, &block)
|
64
|
+
end
|
65
|
+
|
62
66
|
def silence!
|
63
67
|
@silenced.value = true
|
64
68
|
yield if block_given?
|
@@ -140,7 +144,7 @@ module Klogger
|
|
140
144
|
[Klogger.global_groups, @group_set].each do |group_set|
|
141
145
|
group_set.groups.each do |group|
|
142
146
|
payload.merge!(group[:tags])
|
143
|
-
group_ids << group[:id]
|
147
|
+
group_ids << group[:id] if group[:id]
|
144
148
|
end
|
145
149
|
end
|
146
150
|
|
data/lib/klogger.rb
CHANGED