slack_log_device 4.0.0 → 4.0.1
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.mdown +1 -1
- data/VERSION +1 -1
- data/lib/slack_log_device.rb +2 -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: 72581be793e8126c5edc0618a27638f5a6de5f6f
|
4
|
+
data.tar.gz: ed4c06d973fe0d78360a3fcb45c888b65b5f5e57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbebab53db046820e98273a52a69ca46f3aab5e97595263b38e07eb1ee01b490a4659c7009d3964e911a44d4064ada9feb8b1674bebd44419039e71a5f5ddf69
|
7
|
+
data.tar.gz: e926f6f68041fcfdd395052066b26bf3746456f3f88dd12db7926b7784cd3f3bfa529e692a1b9c3831dd01803de07ebfa27ed6958572d8f9ff2b3d9b453c9de2
|
data/README.mdown
CHANGED
@@ -83,7 +83,7 @@ For a rails application, it is recommanded to use following configuration into
|
|
83
83
|
```ruby
|
84
84
|
SlackLogDevice.enable_rails_logging!
|
85
85
|
config.logger = ActiveSupport::Logger.new(SlackLogDevice.new(webhook_url: 'https://hooks.slack.com/services/...', username: 'MyRailsApp'))
|
86
|
-
config.logger.formatter = SlackLogDevice
|
86
|
+
config.logger.formatter = SlackLogDevice.formatter
|
87
87
|
config.log_level = :warn
|
88
88
|
```
|
89
89
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.0.
|
1
|
+
4.0.1
|
data/lib/slack_log_device.rb
CHANGED
@@ -30,6 +30,7 @@ class SlackLogDevice
|
|
30
30
|
self.timeout = options.key?(:timeout) ? options[:timeout] : 5
|
31
31
|
self.username = options[:username]
|
32
32
|
self.webhook_url = options[:webhook_url]
|
33
|
+
at_exit { flush }
|
33
34
|
end
|
34
35
|
|
35
36
|
def auto_flush?
|
@@ -56,6 +57,7 @@ class SlackLogDevice
|
|
56
57
|
@mutex.synchronize do
|
57
58
|
message = @buffer.pop
|
58
59
|
end
|
60
|
+
next if message.blank?
|
59
61
|
data = { 'text' => message.to_s }
|
60
62
|
data['channel'] = channel if channel.present?
|
61
63
|
data['username'] = username if username.present?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slack_log_device
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexis Toulotte
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-02-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|