sidekiq_parameters_logging 1.1.0 → 1.2.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 +4 -4
- data/README.markdown +7 -7
- data/lib/sidekiq/parameters/logging.rb +1 -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: f65e48a92b69f90ec6fc22397f855414d980abe0
|
4
|
+
data.tar.gz: b5eaeb7f6808e1c80cab6126c0bf7469117cbdd8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8260cf3f2571e994685358555ea878cb7d04704af57d9102dd71b281d79a4e41dc20e06ad23e6862946fa3c389e2b8568af31edd0a91a8e1a785c54de5ece5e4
|
7
|
+
data.tar.gz: db59c38c34e4c6c3fb8d7c29262f59a99302088e63a8f1a3e470dab4df04abf17ea39b01ea63fb7a09b333c71ff78939cf0524717fdc5f0aea5a9e579299fbb7
|
data/README.markdown
CHANGED
@@ -12,7 +12,7 @@ class Worker
|
|
12
12
|
end
|
13
13
|
```
|
14
14
|
|
15
|
-
When you run sidekiq, you see this:
|
15
|
+
When you run sidekiq, you will see this:
|
16
16
|
|
17
17
|
```
|
18
18
|
# without Sidekiq::Parameters::Logging
|
@@ -36,24 +36,24 @@ gem 'sidekiq_parameters_logging'
|
|
36
36
|
|
37
37
|
## Log Filtering
|
38
38
|
|
39
|
-
You can also filter the parameters that you want to get
|
39
|
+
You can also filter the parameters that you want to get printed out to the log:
|
40
40
|
|
41
41
|
```ruby
|
42
42
|
class Worker
|
43
43
|
include Sidekiq::Worker
|
44
44
|
include Sidekiq::Parameters::Logger
|
45
45
|
|
46
|
-
logger_filter do |
|
47
|
-
|
46
|
+
logger_filter do |param1, param2|
|
47
|
+
params1 # only print out the last parameter
|
48
48
|
end
|
49
49
|
|
50
|
-
def perform(
|
50
|
+
def perform(param1, param2)
|
51
51
|
# do something
|
52
52
|
end
|
53
53
|
end
|
54
54
|
```
|
55
55
|
|
56
|
-
`logger_filter` takes a block with
|
56
|
+
`logger_filter` takes a block with parameters that are being passed to your `perform` method. Logger will then print out whatever that is returned from this block with `.inspect`.
|
57
57
|
|
58
58
|
## Notes
|
59
59
|
|
@@ -69,4 +69,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
69
69
|
|
70
70
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
71
71
|
|
72
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
72
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -11,7 +11,7 @@ module Sidekiq
|
|
11
11
|
worker_class = worker.class
|
12
12
|
if worker_class.respond_to?(:filter_block) && worker_class.filter_block
|
13
13
|
logger.info do
|
14
|
-
"parameters: #{worker_class.filter_block.call(item['args'].clone).inspect}"
|
14
|
+
"parameters: #{worker_class.filter_block.call(*(item['args'].clone)).inspect}"
|
15
15
|
end
|
16
16
|
else
|
17
17
|
logger.info { "parameters: #{item['args'].inspect}" }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq_parameters_logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Teng Siong Ong
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sidekiq
|