juan_pelota 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -25
- data/lib/juan_pelota/configuration.rb +9 -1
- data/lib/juan_pelota/logger.rb +3 -5
- data/lib/juan_pelota/version.rb +1 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08793d7d86b7c9ecd2903164efd324092ec7043a
|
4
|
+
data.tar.gz: 01349f44a110866d17344c06024e2b4ae2852f48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc0d4f888eedea77e2b3de4808b9abfde80fce8052cc5050b7761f6b284ef21c96f9a1651ed23facb98898962d115f667e22bcc8d6f5266d40a408b4ca6435df
|
7
|
+
data.tar.gz: 0c5b8a5b5e9dee0ee2f70fde94e75e711a31fbfd1771edac39a1531c9c8452c8db33ff3fd43cdb2f75f0c1acd415177cacee2e6af6ff11a9725d0d17c780ca48
|
data/README.md
CHANGED
@@ -1,28 +1,7 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
[Elasticsearch](http://www.elasticsearch.org/). An Elasticsearch index
|
6
|
-
consists of JSON documents. To make it possible to make fine grained
|
7
|
-
queries on [Sidekiq](http://sidekiq.org/) logs, we needed logging in
|
8
|
-
JSON format. This gem contains that logger.
|
9
|
-
|
10
|
-
### Example log entry:
|
11
|
-
|
12
|
-
```json
|
13
|
-
{
|
14
|
-
"@timestamp": "2014-06-05T12:38:42Z",
|
15
|
-
"pid": 8630,
|
16
|
-
"tid": "TID-osammcf2k",
|
17
|
-
"context": "TrainingIndexer::Work JID-177066e96052c2314dcad8c7",
|
18
|
-
"severity": "INFO",
|
19
|
-
"program_name": "TrainingIndexer::Work",
|
20
|
-
"type": "sidekiq",
|
21
|
-
"message": "2014-06-05T12:38:42Z 8630 TID-osammcf2k TrainingIndexer::Work JID-177066e96052c2314dcad8c7 INFO: done: 51.579 sec",
|
22
|
-
"status": "done",
|
23
|
-
"run_time": 51.579
|
24
|
-
}
|
25
|
-
```
|
1
|
+
# Juan Pelota
|
2
|
+
|
3
|
+
Named after Lance Armstrong's coffee shop [Juan Pelota](http://www.juanpelotacafe.com/)
|
4
|
+
in Austin, TX.
|
26
5
|
|
27
6
|
## Installation
|
28
7
|
|
@@ -9,10 +9,18 @@ module JuanPelota
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
class
|
12
|
+
class Configuration
|
13
13
|
include Singleton
|
14
14
|
|
15
15
|
attr_accessor :filtered_arguments,
|
16
16
|
:filtered_workers
|
17
|
+
|
18
|
+
def filtered_arguments
|
19
|
+
@filtered_arguments || []
|
20
|
+
end
|
21
|
+
|
22
|
+
def filtered_workers
|
23
|
+
@filtered_workers || []
|
24
|
+
end
|
17
25
|
end
|
18
26
|
end
|
data/lib/juan_pelota/logger.rb
CHANGED
@@ -4,14 +4,13 @@ require 'json'
|
|
4
4
|
|
5
5
|
module JuanPelota
|
6
6
|
class Logger < Sidekiq::Logging::Pretty
|
7
|
-
IGNORABLE_STATUSES = %w{start done queueing}
|
7
|
+
IGNORABLE_STATUSES = %w{start done queueing}.freeze
|
8
8
|
|
9
9
|
attr_accessor :severity,
|
10
10
|
:timestamp,
|
11
11
|
:program_name,
|
12
12
|
:raw_message
|
13
13
|
|
14
|
-
# rubocop:disable Metrics/AbcSize
|
15
14
|
def call(severity, time, program_name, incoming_message)
|
16
15
|
self.severity = severity
|
17
16
|
self.timestamp = time.utc.iso8601
|
@@ -38,7 +37,6 @@ class Logger < Sidekiq::Logging::Pretty
|
|
38
37
|
},
|
39
38
|
}.to_json + "\n"
|
40
39
|
end
|
41
|
-
# rubocop:enable Metrics/AbcSize
|
42
40
|
|
43
41
|
private
|
44
42
|
|
@@ -55,11 +53,11 @@ class Logger < Sidekiq::Logging::Pretty
|
|
55
53
|
elsif @raw_message.respond_to?(:match) &&
|
56
54
|
@raw_message.match(/:\d+:in\s`/)
|
57
55
|
{
|
58
|
-
'message' => @raw_message.lines.first(10).map(&:chomp)
|
56
|
+
'message' => @raw_message.lines.first(10).map(&:chomp)
|
59
57
|
}
|
60
58
|
else
|
61
59
|
{
|
62
|
-
'message' => @raw_message
|
60
|
+
'message' => @raw_message
|
63
61
|
}
|
64
62
|
end
|
65
63
|
end
|
data/lib/juan_pelota/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: juan_pelota
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thekompanee
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-12-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sidekiq
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '4.0'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '4.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: rspec
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,10 +117,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
version: '0'
|
118
118
|
requirements: []
|
119
119
|
rubyforge_project:
|
120
|
-
rubygems_version: 2.4.
|
120
|
+
rubygems_version: 2.4.5.1
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Log Sidekiq messages in JSON format
|
124
124
|
test_files:
|
125
125
|
- spec/juan_pelota/logger_spec.rb
|
126
126
|
- spec/spec_helper.rb
|
127
|
+
has_rdoc:
|