slack_log_device 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b8c2c4a011a4ba09610beb398cfb992ed65a2f7
4
- data.tar.gz: 9499a0f40302d799977eeca879cdc1746cb557b5
3
+ metadata.gz: 72581be793e8126c5edc0618a27638f5a6de5f6f
4
+ data.tar.gz: ed4c06d973fe0d78360a3fcb45c888b65b5f5e57
5
5
  SHA512:
6
- metadata.gz: 517127197dfe3563a572c58c3b5ad7a628c8773fd29baada89188d6b0a37ebbe0ed80a6e9728881216801de9868dcc4746766fbcab54d9b442065a04c172f35e
7
- data.tar.gz: b89dfd5dfca5b6fbcc1549a7527f7e5f763b228c6cf9db86221e93674043f0a078ed2a13323d44cfecf6405acc7fb4045343d5fa179fa0d3de1cdd13a338f47f
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::FORMATTER
86
+ config.logger.formatter = SlackLogDevice.formatter
87
87
  config.log_level = :warn
88
88
  ```
89
89
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.0.0
1
+ 4.0.1
@@ -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.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-01-29 00:00:00.000000000 Z
11
+ date: 2017-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport