alephant-logger-json 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c74f8754607a0e50a87ac50ab6a2d49ed78d415
4
- data.tar.gz: f1a8828ff15ea75f8bf2defaa376cce91dc42084
3
+ metadata.gz: 3968d465458c83d5311c94efbca73fc9d51573cf
4
+ data.tar.gz: a132988fc00b3aafc4e504be158512de6e903f5f
5
5
  SHA512:
6
- metadata.gz: 5947d4edc0626848c3f6ce371b153f3c8e0a99847bfe360f3057573e329254502c92b308453fc12537236dbfbcb8386fa04efe24071cd432fb2b6b2aff8e228b
7
- data.tar.gz: 435ad37ec0b3b8ae88cb619ebd11a49c9176d49a8d1a0f9d80fdcbf0d1a10ecc2b1ca23df5562b098010b8412f8ba5e20571e868c036053642bd86fe4b939c45
6
+ metadata.gz: 22d2e4a1564a559732dd57b738944b969b3cc73c3341c0fd1c69dc364acfb0bd7e3b9eaff853b7049cba1aa6e136e98a53139eb8538265dd4c237d0b23c32cfd
7
+ data.tar.gz: f7485a3235e148c99eeefb6b5116886b6840bb9e9121e15dd2cb876b33428deaaa83fa61645fe34f8a9ce678e2df90340b8d2557a6509d287f32f5eae0c98bb1
@@ -5,11 +5,12 @@ module Alephant
5
5
  class JSON
6
6
  def initialize(log_path)
7
7
  @log_file = File.open(log_path, "a+")
8
+ @log_file.sync = true
8
9
  end
9
10
 
10
11
  [:debug, :info, :warn, :error].each do |level|
11
12
  define_method(level) do |hash|
12
- hash["level"] = level
13
+ hash["level"] = level.to_s
13
14
  @log_file.write(::JSON.generate(hash) + "\n")
14
15
  end
15
16
  end
@@ -1,7 +1,7 @@
1
1
  module Alephant
2
2
  module Logger
3
3
  class JSON
4
- VERSION = "0.0.1"
4
+ VERSION = "0.0.2"
5
5
  end
6
6
  end
7
7
  end
@@ -12,6 +12,7 @@ describe Alephant::Logger::JSON do
12
12
 
13
13
  before do
14
14
  allow(File).to receive(:open) { log_file }
15
+ allow(log_file).to receive :sync=
15
16
  end
16
17
 
17
18
  shared_examples "JSON logging" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alephant-logger-json
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Arnould
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-17 00:00:00.000000000 Z
11
+ date: 2015-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement