birling 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/birling.gemspec +1 -1
- data/lib/birling/formatter.rb +2 -2
- data/lib/birling/logger.rb +1 -0
- data/test/test_birling_logger.rb +16 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/birling.gemspec
CHANGED
data/lib/birling/formatter.rb
CHANGED
@@ -7,9 +7,9 @@ module Birling::Formatter
|
|
7
7
|
|
8
8
|
def self.call(severity, time, program, message)
|
9
9
|
if (program)
|
10
|
-
"[#{time.strftime(TIME_FORMAT_DEFAULT)}] <#{program}> #{message}"
|
10
|
+
"[#{time.strftime(TIME_FORMAT_DEFAULT)}] <#{program}> #{message}\n"
|
11
11
|
else
|
12
|
-
"[#{time.strftime(TIME_FORMAT_DEFAULT)}] #{message}"
|
12
|
+
"[#{time.strftime(TIME_FORMAT_DEFAULT)}] #{message}\n"
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
data/lib/birling/logger.rb
CHANGED
data/test/test_birling_logger.rb
CHANGED
@@ -178,6 +178,22 @@ class TestBirlingLogger < Test::Unit::TestCase
|
|
178
178
|
assert_equal retain_count, Dir.glob(logger.path_format % '*').length
|
179
179
|
end
|
180
180
|
end
|
181
|
+
|
182
|
+
def test_default_formatter
|
183
|
+
temp_path(:cycle) do |path|
|
184
|
+
logger = Birling::Logger.new(path)
|
185
|
+
|
186
|
+
lines = 100
|
187
|
+
|
188
|
+
lines.times do
|
189
|
+
logger.debug("Test")
|
190
|
+
end
|
191
|
+
|
192
|
+
logger.close
|
193
|
+
|
194
|
+
assert_equal lines, File.readlines(path).length
|
195
|
+
end
|
196
|
+
end
|
181
197
|
|
182
198
|
def test_retain_period
|
183
199
|
temp_path(:cycle) do |path|
|