itamae 1.0.0.beta15 → 1.0.0.beta16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/itamae/cli.rb +1 -0
- data/lib/itamae/logger.rb +19 -10
- data/lib/itamae/version.txt +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: af7d4bb27ff01452de7a18a4746c839a6e8acb39
|
4
|
+
data.tar.gz: 81c20c90b909d57b4bbf55c3bc0e8e436a00d314
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0615f89f2348df43c96f003a792f71443425dff36c1851b937727f18937978583c630298b1d710e494304474af484d00a8117f67bc89ecf46cde3c8e66c73fe2
|
7
|
+
data.tar.gz: 4440f3fa23bb0d0cb4be68d4b9d87c62bc815b45df972d42b895e6e229c531a1aaf1dee1391346838afd91bb5822bda72cfb731bf549411b4bf4a01291ad205f
|
data/lib/itamae/cli.rb
CHANGED
data/lib/itamae/logger.rb
CHANGED
@@ -5,8 +5,15 @@ require 'ansi/code'
|
|
5
5
|
module Itamae
|
6
6
|
module Logger
|
7
7
|
class Formatter
|
8
|
+
attr_accessor :colored
|
9
|
+
|
8
10
|
def call(severity, datetime, progname, msg)
|
9
|
-
severity =
|
11
|
+
severity = "%5s" % severity
|
12
|
+
|
13
|
+
if colored
|
14
|
+
severity = color(severity, severity)
|
15
|
+
end
|
16
|
+
|
10
17
|
"[%s] %s : %s\n" % [format_datetime(datetime), severity, msg2str(msg)]
|
11
18
|
end
|
12
19
|
|
@@ -40,18 +47,20 @@ module Itamae
|
|
40
47
|
end
|
41
48
|
end
|
42
49
|
|
43
|
-
|
44
|
-
|
45
|
-
logger
|
50
|
+
class << self
|
51
|
+
def logger
|
52
|
+
@logger ||= ::Logger.new($stdout).tap do |logger|
|
53
|
+
logger.formatter = Formatter.new
|
54
|
+
end
|
46
55
|
end
|
47
|
-
end
|
48
56
|
|
49
|
-
|
50
|
-
|
51
|
-
|
57
|
+
def logger=(l)
|
58
|
+
@logger = l
|
59
|
+
end
|
52
60
|
|
53
|
-
|
54
|
-
|
61
|
+
def method_missing(method, *args, &block)
|
62
|
+
logger.public_send(method, *args, &block)
|
63
|
+
end
|
55
64
|
end
|
56
65
|
end
|
57
66
|
end
|
data/lib/itamae/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.0.
|
1
|
+
1.0.0.beta16
|