logasm 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/logasm/utils.rb +2 -1
- data/logasm.gemspec +1 -1
- data/spec/utils_spec.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d617fe6f30cdd7d5019618e9d4156d558539860
|
4
|
+
data.tar.gz: f24dfbacbc3c18d94839770304c5c7ccdf841dce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 902f38928193719f4c23f4297da8049aa785adcab3d6c4a1620d6a7f716cdd9b90b991567f24dceb51b5fd3dd0015d5559173b1d0ac3673b81f4a37b1f4e44e4
|
7
|
+
data.tar.gz: 66ad45f23be1dbb5c0e07cfa21222641149d48f7db3946f61ad5b32f59afafb4f6bdd5b0f7e80be563bbd9c2a8101721a4abefe71dbf15a7dde49ac6ee394da6
|
data/Gemfile.lock
CHANGED
data/lib/logasm/utils.rb
CHANGED
@@ -3,6 +3,7 @@ require 'socket'
|
|
3
3
|
class Logasm
|
4
4
|
module Utils
|
5
5
|
HOST = ::Socket.gethostname
|
6
|
+
DECIMAL_FRACTION_OF_SECOND = 3
|
6
7
|
|
7
8
|
# Build logstash json compatible event
|
8
9
|
#
|
@@ -34,7 +35,7 @@ class Logasm
|
|
34
35
|
|
35
36
|
def self.overwritable_params
|
36
37
|
{
|
37
|
-
:@timestamp => Time.now.utc.iso8601,
|
38
|
+
:@timestamp => Time.now.utc.iso8601(DECIMAL_FRACTION_OF_SECOND),
|
38
39
|
host: HOST
|
39
40
|
}
|
40
41
|
end
|
data/logasm.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "logasm"
|
7
|
-
gem.version = '0.2.
|
7
|
+
gem.version = '0.2.5'
|
8
8
|
gem.authors = ["Salemove"]
|
9
9
|
gem.email = ["support@salemove.com"]
|
10
10
|
gem.description = %q{It's logasmic}
|
data/spec/utils_spec.rb
CHANGED
@@ -8,6 +8,10 @@ describe Logasm::Utils do
|
|
8
8
|
let(:level) { 'INFO' }
|
9
9
|
let(:metadata) { {x: 'y'} }
|
10
10
|
|
11
|
+
before do
|
12
|
+
allow(Time).to receive(:now) { Time.utc(2015, 10, 11, 23, 10, 21, 123456) }
|
13
|
+
end
|
14
|
+
|
11
15
|
context 'when service name is in correct format' do
|
12
16
|
it 'includes it in the event as application' do
|
13
17
|
expect(event[:application]).to eq('test_service')
|
@@ -27,7 +31,7 @@ describe Logasm::Utils do
|
|
27
31
|
end
|
28
32
|
|
29
33
|
it 'includes timestamp' do
|
30
|
-
expect(event[:@timestamp]).to
|
34
|
+
expect(event[:@timestamp]).to eq('2015-10-11T23:10:21.123Z')
|
31
35
|
end
|
32
36
|
|
33
37
|
it 'includes the host' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logasm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salemove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inflecto
|