enhanced-logger 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/enhanced_logger/logger.rb +11 -11
- data/lib/enhanced_logger/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: dbb27cef891438a0c1fe03c5dff29ff8a01e6886
|
4
|
+
data.tar.gz: 1d9e2d85bb98ba72d05eb153241184a2565936ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f79f12df2fb40151d13f61a0ca1c9743a2a1c0c426c1512616a80bf82032a8ec3955999d13a27280667470e284b6db962b16de045b47d20ee06c7c81f9cda8d0
|
7
|
+
data.tar.gz: fdcc4d17bc2bd77c4a5dada5681b519fc437764beee8b84a25034a813200142b0279222ce2b51dc3199c4e81c9d51f89c62e239956500dd8b09614f0cad820b3
|
@@ -5,7 +5,7 @@ module EnhancedLogger
|
|
5
5
|
attr_accessor :level
|
6
6
|
|
7
7
|
def initialize level=:info
|
8
|
-
@level =
|
8
|
+
@level = level || :info
|
9
9
|
$stdout.sync = true
|
10
10
|
end
|
11
11
|
|
@@ -20,43 +20,43 @@ module EnhancedLogger
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def debug?
|
23
|
-
@level <= LEVELS[ :debug ]
|
23
|
+
LEVELS[ @level ] <= LEVELS[ :debug ]
|
24
24
|
end
|
25
25
|
|
26
26
|
def info?
|
27
|
-
@level
|
27
|
+
LEVELS[ @level ] <= LEVELS[ :info ]
|
28
28
|
end
|
29
29
|
|
30
30
|
def warn?
|
31
|
-
@level <= LEVELS[ :warn ]
|
31
|
+
LEVELS[ @level ] <= LEVELS[ :warn ]
|
32
32
|
end
|
33
33
|
|
34
34
|
def error?
|
35
|
-
@level <= LEVELS[ :error ]
|
35
|
+
LEVELS[ @level ] <= LEVELS[ :error ]
|
36
36
|
end
|
37
37
|
|
38
38
|
def fatal?
|
39
|
-
@level <= LEVELS[ :fatal ]
|
39
|
+
LEVELS[ @level ] <= LEVELS[ :fatal ]
|
40
40
|
end
|
41
41
|
|
42
42
|
|
43
|
-
def debug msg
|
43
|
+
def debug msg=nil
|
44
44
|
puts formatted( msg ) if debug?
|
45
45
|
end
|
46
46
|
|
47
|
-
def info msg
|
47
|
+
def info msg=nil
|
48
48
|
puts formatted( msg ) if info?
|
49
49
|
end
|
50
50
|
|
51
|
-
def warn msg
|
51
|
+
def warn msg=nil
|
52
52
|
puts formatted( msg ) if warn?
|
53
53
|
end
|
54
54
|
|
55
|
-
def error msg
|
55
|
+
def error msg=nil
|
56
56
|
puts formatted( msg ) if error?
|
57
57
|
end
|
58
58
|
|
59
|
-
def fatal msg
|
59
|
+
def fatal msg=nil
|
60
60
|
puts formatted( msg ) if fatal?
|
61
61
|
end
|
62
62
|
|