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 CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
data/birling.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "birling"
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Scott Tadman"]
@@ -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
@@ -241,6 +241,7 @@ protected
241
241
  @current_path = @time_source.now.strftime(@path_format)
242
242
 
243
243
  @log = File.open(@current_path, 'a')
244
+ @log.sync = true
244
245
 
245
246
  if (File.exist?(@path) and File.symlink?(@path))
246
247
  File.unlink(@path)
@@ -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|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: birling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: