stderr_logger 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/stderr_logger.rb +3 -3
- data/lib/stderr_logger/version.rb +1 -1
- data/test/test_logger.rb +5 -4
- metadata +3 -3
data/lib/stderr_logger.rb
CHANGED
@@ -17,12 +17,12 @@ module StderrLogger
|
|
17
17
|
if USE_COLOR
|
18
18
|
self.formatter = proc { |severity, datetime, progname, msg|
|
19
19
|
time = datetime.strftime("%b %e %H:%M:%S")
|
20
|
-
"#{time} #{File.basename($0)} : #{colorize(msg, SEVERITY_TO_COLOR[severity])}"
|
20
|
+
"#{time} #{File.basename($0)} : #{colorize(msg, SEVERITY_TO_COLOR[severity])}\n"
|
21
21
|
}
|
22
22
|
else
|
23
23
|
self.formatter = proc { |severity, datetime, progname, msg|
|
24
24
|
time = datetime.strftime("%b %e %H:%M:%S")
|
25
|
-
"#{time} #{File.basename($0)} #{severity} : #{msg}"
|
25
|
+
"#{time} #{File.basename($0)} #{severity} : #{msg}\n"
|
26
26
|
}
|
27
27
|
end
|
28
28
|
end
|
@@ -41,6 +41,6 @@ class Object
|
|
41
41
|
StderrLogger.logger.info(*args)
|
42
42
|
end
|
43
43
|
def error(*args)
|
44
|
-
StderrLogger.logger.
|
44
|
+
StderrLogger.logger.error(*args)
|
45
45
|
end
|
46
46
|
end
|
data/test/test_logger.rb
CHANGED
@@ -17,16 +17,17 @@ class TestStderrLogger < Test::Unit::TestCase
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def test_info
|
20
|
-
@logdev.expects(:write).with("Jan 1 23:23:00 el_programa INFO : hola")
|
20
|
+
@logdev.expects(:write).with("Jan 1 23:23:00 el_programa INFO : hola\n")
|
21
21
|
info "hola"
|
22
22
|
end
|
23
23
|
def test_error
|
24
|
-
@logdev.expects(:write).with("Jan 1 23:23:00 el_programa ERROR : hola")
|
24
|
+
@logdev.expects(:write).with("Jan 1 23:23:00 el_programa ERROR : hola\n")
|
25
25
|
error "hola"
|
26
26
|
end
|
27
|
+
|
27
28
|
def test_debug
|
28
|
-
@logdev.expects(:write).with("Jan 1 23:23:00 el_programa DEBUG : hola")
|
29
|
-
|
29
|
+
@logdev.expects(:write).with("Jan 1 23:23:00 el_programa DEBUG : hola\n")
|
30
|
+
debug "hola"
|
30
31
|
end
|
31
32
|
|
32
33
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stderr_logger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Guillermo A\xCC\x81lvarez"
|