logasm 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/Rakefile +2 -0
- data/lib/logasm/utils.rb +14 -6
- data/logasm.gemspec +1 -1
- data/spec/utils_spec.rb +18 -0
- 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: f4fb5320608a9281ac19839580efd95841f32aab
|
4
|
+
data.tar.gz: 8430bbe0cbc2da45220dc0561ef930e89186d1bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11bd6d3a0334fab84540705fccb166a50089de39874d6547ce91317ffe798e3d642f7e7f046c1c31a4a93211b3fb31a920e3bd2a9ee564c3f67bf530a97f0288
|
7
|
+
data.tar.gz: 2886b7fd506e8da359889c313cf914d85b8083eff115673bf86d7781e2d0569a6a67967daf3ee0b4900b8285767fda433c6c2b64f8906625c5b9d827eb9b2450
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
logasm (0.2.
|
4
|
+
logasm (0.2.4)
|
5
5
|
inflecto
|
6
6
|
|
7
7
|
GEM
|
@@ -13,7 +13,7 @@ GEM
|
|
13
13
|
amq-protocol (>= 1.9.2)
|
14
14
|
coderay (1.1.0)
|
15
15
|
diff-lcs (1.2.5)
|
16
|
-
freddy (0.4.
|
16
|
+
freddy (0.4.2)
|
17
17
|
bunny (= 1.6.3)
|
18
18
|
hamster (~> 1.0.1.pre.rc3)
|
19
19
|
symbolizer
|
data/Rakefile
CHANGED
data/lib/logasm/utils.rb
CHANGED
@@ -12,12 +12,12 @@ class Logasm
|
|
12
12
|
#
|
13
13
|
# @return [Hash]
|
14
14
|
def self.build_event(metadata, level, service_name)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
overwritable_params
|
16
|
+
.merge(metadata)
|
17
|
+
.merge(
|
18
|
+
application: application_name(service_name),
|
19
|
+
level: level.to_s.downcase
|
20
|
+
)
|
21
21
|
end
|
22
22
|
|
23
23
|
# Return application name
|
@@ -31,5 +31,13 @@ class Logasm
|
|
31
31
|
def self.application_name(service_name)
|
32
32
|
Inflecto.underscore(service_name)
|
33
33
|
end
|
34
|
+
|
35
|
+
def self.overwritable_params
|
36
|
+
{
|
37
|
+
:@timestamp => Time.now.utc.iso8601,
|
38
|
+
host: HOST
|
39
|
+
}
|
40
|
+
end
|
41
|
+
private_class_method :overwritable_params
|
34
42
|
end
|
35
43
|
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.4'
|
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
@@ -33,5 +33,23 @@ describe Logasm::Utils do
|
|
33
33
|
it 'includes the host' do
|
34
34
|
expect(event[:host]).to be_a(String)
|
35
35
|
end
|
36
|
+
|
37
|
+
context 'when @timestamp provided' do
|
38
|
+
let(:metadata) { {message: 'test', :@timestamp => 'a timestamp'} }
|
39
|
+
|
40
|
+
it 'overwrites @timestamp' do
|
41
|
+
expect(subject[:message]).to eq('test')
|
42
|
+
expect(subject[:@timestamp]).to eq('a timestamp')
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'when host provided' do
|
47
|
+
let(:metadata) { {message: 'test', host: 'xyz'} }
|
48
|
+
|
49
|
+
it 'overwrites host' do
|
50
|
+
expect(subject[:message]).to eq('test')
|
51
|
+
expect(subject[:host]).to eq('xyz')
|
52
|
+
end
|
53
|
+
end
|
36
54
|
end
|
37
55
|
end
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Salemove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09
|
11
|
+
date: 2015-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inflecto
|