dns_one 0.4.47 → 0.4.48
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dns_one/log.rb +8 -5
- data/lib/dns_one/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5594e70d0e8e9e4e1a48fdfd912d679708807ba
|
4
|
+
data.tar.gz: f07e8e672204c721295f875542f4a5e3f41ea8da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d36a7402147335e9390e9486ff972648fc9ad0142581021a6fff15848470a0b13f6e589800aad62c0bf09e14a68c6d772c70f7600e89f2b1a79bb5e01a8e2d1
|
7
|
+
data.tar.gz: d7beb92f9e3d1b3bbe9f244086cbed96cbaa721faaa46d28c5fd361c2a775f944ef3e8e0a1f0621040e051e3042bd368154e3d063a124e30a75b0084b56ce7f0
|
data/lib/dns_one/log.rb
CHANGED
@@ -5,11 +5,10 @@ class Log < Logger
|
|
5
5
|
class << self
|
6
6
|
|
7
7
|
# 'def [d|i|w|e|f] msg' for DEBUG INFO WARN ERROR FATAL
|
8
|
-
Logger::Severity::constants.
|
9
|
-
next if severity == :UNKNOWN
|
8
|
+
Logger::Severity::constants.each do |severity|
|
10
9
|
method_name = severity.to_s[0].downcase
|
11
10
|
define_method(method_name) do |msg|
|
12
|
-
log
|
11
|
+
log severity, msg
|
13
12
|
end
|
14
13
|
end
|
15
14
|
|
@@ -56,14 +55,18 @@ class Log < Logger
|
|
56
55
|
end
|
57
56
|
|
58
57
|
def log severity, msg
|
59
|
-
met_name =
|
58
|
+
met_name = severity.downcase
|
60
59
|
|
61
60
|
@logger.send met_name, msg
|
62
61
|
|
63
|
-
if severity >= SYSLOG_MIN_SEVERITY
|
62
|
+
if sev_num(severity) >= SYSLOG_MIN_SEVERITY
|
64
63
|
@syslog.send met_name, msg
|
65
64
|
end
|
66
65
|
end
|
66
|
+
|
67
|
+
def sev_num sev
|
68
|
+
Object.const_get "Logger::#{sev}"
|
69
|
+
end
|
67
70
|
end
|
68
71
|
end
|
69
72
|
|
data/lib/dns_one/version.rb
CHANGED