rdo 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rdo/colored_logger.rb +3 -1
- data/lib/rdo/version.rb +1 -1
- metadata +1 -1
data/lib/rdo/colored_logger.rb
CHANGED
@@ -12,6 +12,7 @@ module RDO
|
|
12
12
|
class ColoredLogger < Logger
|
13
13
|
def initialize(*args)
|
14
14
|
super
|
15
|
+
@colors = [35, 36]
|
15
16
|
self.formatter = color_formatter
|
16
17
|
end
|
17
18
|
|
@@ -31,7 +32,8 @@ module RDO
|
|
31
32
|
end
|
32
33
|
|
33
34
|
def format_sql(sql)
|
34
|
-
|
35
|
+
a, b = @colors.reverse!
|
36
|
+
"\033[#{a}mSQL\033[0m %s" % sql.sub(/\A(\(\d+\.\d+\))(.*)\Z/, "\\1 \033[#{b}m~\033[0m \\2")
|
35
37
|
end
|
36
38
|
|
37
39
|
def format_err(msg)
|
data/lib/rdo/version.rb
CHANGED