juan_pelota 2.1.0 → 3.0.0
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.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data/LICENSE.txt +19 -0
- data/lib/juan_pelota/configuration.rb +2 -2
- data/lib/juan_pelota/logger.rb +12 -10
- data/lib/juan_pelota/middlewares/logging.rb +8 -8
- data/lib/juan_pelota/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +34 -29
- metadata.gz.sig +0 -0
- data/LICENSE +0 -22
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8d3ad11775f22c6779a0181bb3ebdac39f23b15fc1d929eddb704d39d4eac137
|
4
|
+
data.tar.gz: dffa44eda6417af4e0ac1c8ca2cf812d3491cb4a3ee9425f20487ee39e81721d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e958cf459d7de7e468ff595b805364b3ea7444bad7c69e6c473665873e54632958bfff2bc70c9f6a0297ab2762fc84c192d8cf9cdc27e246a9c45aa4541a73c
|
7
|
+
data.tar.gz: b66950aac6dceefa71bd1cb0ee70812aa3fabd3ace60af47d6121dd3474758608ef8e4e48ba219c4b1368ee92709f01fa330861dbbf1de83379f8c94e42fb710
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
Copyright (c) 2010-2016 The Kompanee, Ltd
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/lib/juan_pelota/logger.rb
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'sidekiq/
|
3
|
+
require 'sidekiq/logger'
|
4
4
|
require 'juan_pelota/version'
|
5
5
|
require 'juan_pelota'
|
6
6
|
require 'json'
|
7
7
|
|
8
8
|
module JuanPelota
|
9
|
-
class Logger < ::Sidekiq::
|
9
|
+
class Logger < ::Sidekiq::Logger::Formatters::Base
|
10
10
|
IGNORABLE_STATUSES = %w{start done queueing}.freeze
|
11
11
|
|
12
12
|
attr_accessor :severity,
|
13
13
|
:timestamp,
|
14
|
-
:program_name
|
15
|
-
|
14
|
+
:program_name
|
15
|
+
attr_writer :raw_message
|
16
16
|
|
17
|
-
def call(severity, time, program_name, incoming_message)
|
17
|
+
def call(severity, time, program_name, incoming_message) # rubocop:disable Metrics/AbcSize
|
18
18
|
self.severity = severity
|
19
19
|
self.timestamp = time.utc.iso8601
|
20
20
|
self.program_name = program_name
|
@@ -23,7 +23,7 @@ class Logger < ::Sidekiq::Logging::Pretty
|
|
23
23
|
return if config.filtered_workers.include?(worker_name.to_s) &&
|
24
24
|
IGNORABLE_STATUSES.include?(status)
|
25
25
|
|
26
|
-
{
|
26
|
+
{ # rubocop:disable Style/StringConcatenation
|
27
27
|
'@type' => 'sidekiq',
|
28
28
|
'@timestamp' => timestamp,
|
29
29
|
'@status' => status,
|
@@ -33,7 +33,7 @@ class Logger < ::Sidekiq::Logging::Pretty
|
|
33
33
|
'@fields' => {
|
34
34
|
pid: self.class.pid,
|
35
35
|
tid: self.class.tid,
|
36
|
-
context:
|
36
|
+
context: ctx,
|
37
37
|
program_name: program_name,
|
38
38
|
worker: worker_name,
|
39
39
|
arguments: arguments,
|
@@ -51,20 +51,22 @@ class Logger < ::Sidekiq::Logging::Pretty
|
|
51
51
|
|
52
52
|
private
|
53
53
|
|
54
|
-
def raw_message
|
54
|
+
def raw_message # rubocop:disable Metrics/CyclomaticComplexity
|
55
55
|
if @raw_message.is_a? Hash
|
56
56
|
@raw_message
|
57
57
|
elsif @raw_message.respond_to?(:match) &&
|
58
58
|
@raw_message.match(/^queueing/)
|
59
|
+
|
59
60
|
{
|
60
61
|
'status' => 'queueing',
|
61
62
|
'message' => @raw_message,
|
62
|
-
'class' => @raw_message.split
|
63
|
+
'class' => @raw_message.split[1],
|
63
64
|
}
|
64
65
|
elsif @raw_message.respond_to?(:match) &&
|
65
66
|
@raw_message.match(/:\d+:in\s`/)
|
67
|
+
|
66
68
|
{
|
67
|
-
'message' => @raw_message.lines.first(10).map(&:chomp),
|
69
|
+
'message' => @raw_message.lines.first(10).map!(&:chomp),
|
68
70
|
}
|
69
71
|
else
|
70
72
|
{
|
@@ -3,7 +3,7 @@
|
|
3
3
|
module JuanPelota
|
4
4
|
module Middlewares
|
5
5
|
class Logging
|
6
|
-
# rubocop:disable Lint/RescueException, Metrics/AbcSize
|
6
|
+
# rubocop:disable Lint/RescueException, Metrics/AbcSize
|
7
7
|
def call(worker, job, _queue)
|
8
8
|
start = Time.now
|
9
9
|
|
@@ -30,11 +30,11 @@ class Logging
|
|
30
30
|
'args' => filtered_arguments(job['args'].try(:first)),
|
31
31
|
)
|
32
32
|
end
|
33
|
-
rescue Exception =>
|
33
|
+
rescue Exception => error
|
34
34
|
message = {
|
35
|
-
'error_class' =>
|
36
|
-
'error_message' =>
|
37
|
-
'error_backtrace' =>
|
35
|
+
'error_class' => error.class.name,
|
36
|
+
'error_message' => error.message,
|
37
|
+
'error_backtrace' => error.backtrace.first(10),
|
38
38
|
}
|
39
39
|
|
40
40
|
logger.info(
|
@@ -47,12 +47,12 @@ class Logging
|
|
47
47
|
'args' => filtered_arguments(job['args'].try(:first)),
|
48
48
|
)
|
49
49
|
|
50
|
-
raise
|
50
|
+
raise error
|
51
51
|
end
|
52
|
-
# rubocop:enable Lint/RescueException, Metrics/AbcSize
|
52
|
+
# rubocop:enable Lint/RescueException, Metrics/AbcSize
|
53
53
|
|
54
54
|
def elapsed(start)
|
55
|
-
(Time.now - start).
|
55
|
+
Float((Time.now - start)).round(3)
|
56
56
|
end
|
57
57
|
|
58
58
|
def logger
|
data/lib/juan_pelota/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
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: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thekompanee
|
@@ -10,43 +10,49 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
13
|
+
MIIErjCCAxagAwIBAgIBATANBgkqhkiG9w0BAQsFADBOMRowGAYDVQQDDBFhY2Nv
|
14
14
|
dW50c19ydWJ5Z2VtczEbMBkGCgmSJomT8ixkARkWC3RoZWtvbXBhbmVlMRMwEQYK
|
15
|
-
|
15
|
+
CZImiZPyLGQBGRYDY29tMB4XD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J5Z2Vtc0B0aGVrb21wYW5lZS5jb20wLAYDVR0SBCUwI4EhYWNj
|
29
|
+
b3VudHMrcnVieWdlbXNAdGhla29tcGFuZWUuY29tMA0GCSqGSIb3DQEBCwUAA4IB
|
30
|
+
gQA77FB5l21dFSHGwXCHHcvxoNuYl+EC7vgRxBs4jE6Fgn3V5r/eBtQ8XYJ2k2oQ
|
31
|
+
27y98cEozAWH5wjnZTldEABOkhADgYk5gB/ixcs6D+2fM5J8RblrHyyhVydvFCcj
|
32
|
+
5jhG5vYRMlIsTPtjUNueBvXxyyIjysZs5l6YareXJ8Tc9Bliq2ZYlohuMDaw6yqM
|
33
|
+
FrlB+BmbMxMn7agg0s9gh/dAfvZLjveUxeIGzNh8HRb1LJJBBGF9E9KXRhQEEVoN
|
34
|
+
2Q1jYQMxADb6ruQiM9VYIVIfwTrOsF8t9IuoN+xCOUafDQ3Ix3i70BSdzm48toNl
|
35
|
+
0xoB7J4x0kJYk4zrQ9VsLK7xadlR0MC4rfkjPucz41+zOEzoG0hZgoySbR/0K1vX
|
36
|
+
dqKIiQ90U6ghhzc0WhL3K7L50FKfHh1vCXBToYuQIpyWyZtvkTvvDE9vLHmVJH4U
|
37
|
+
wNduo7tKzoOUaVNBOaIdXeZ610yzBamfSN2xNtSord+Y3JTt/Uvn2UmG8QwHqnxq
|
38
|
+
W/M=
|
33
39
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
40
|
+
date: 2022-03-04 00:00:00.000000000 Z
|
35
41
|
dependencies:
|
36
42
|
- !ruby/object:Gem::Dependency
|
37
43
|
name: sidekiq
|
38
44
|
requirement: !ruby/object:Gem::Requirement
|
39
45
|
requirements:
|
40
|
-
- - "
|
46
|
+
- - "~>"
|
41
47
|
- !ruby/object:Gem::Version
|
42
|
-
version: '
|
48
|
+
version: '6.0'
|
43
49
|
type: :runtime
|
44
50
|
prerelease: false
|
45
51
|
version_requirements: !ruby/object:Gem::Requirement
|
46
52
|
requirements:
|
47
|
-
- - "
|
53
|
+
- - "~>"
|
48
54
|
- !ruby/object:Gem::Version
|
49
|
-
version: '
|
55
|
+
version: '6.0'
|
50
56
|
- !ruby/object:Gem::Dependency
|
51
57
|
name: rspec
|
52
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,14 +101,14 @@ dependencies:
|
|
95
101
|
requirements:
|
96
102
|
- - "~>"
|
97
103
|
- !ruby/object:Gem::Version
|
98
|
-
version: 0.
|
104
|
+
version: 0.9.4
|
99
105
|
type: :development
|
100
106
|
prerelease: false
|
101
107
|
version_requirements: !ruby/object:Gem::Requirement
|
102
108
|
requirements:
|
103
109
|
- - "~>"
|
104
110
|
- !ruby/object:Gem::Version
|
105
|
-
version: 0.
|
111
|
+
version: 0.9.4
|
106
112
|
description: ''
|
107
113
|
email:
|
108
114
|
- info@thekompanee.com
|
@@ -110,7 +116,7 @@ executables: []
|
|
110
116
|
extensions: []
|
111
117
|
extra_rdoc_files: []
|
112
118
|
files:
|
113
|
-
- LICENSE
|
119
|
+
- LICENSE.txt
|
114
120
|
- README.md
|
115
121
|
- Rakefile
|
116
122
|
- lib/juan_pelota.rb
|
@@ -138,8 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
144
|
- !ruby/object:Gem::Version
|
139
145
|
version: '0'
|
140
146
|
requirements: []
|
141
|
-
|
142
|
-
rubygems_version: 2.6.8
|
147
|
+
rubygems_version: 3.1.6
|
143
148
|
signing_key:
|
144
149
|
specification_version: 4
|
145
150
|
summary: Log Sidekiq messages in JSON format
|
metadata.gz.sig
CHANGED
Binary file
|
data/LICENSE
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
Copyright (c) 2013 Jeff Felchner
|
2
|
-
|
3
|
-
MIT License
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
a copy of this software and associated documentation files (the
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
12
|
-
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
included in all copies or substantial portions of the Software.
|
15
|
-
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|