slack_log_device 2.2.0 → 2.2.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 +1 -1
- data/spec/slack_log_device_spec.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: 9cfc79231db8c0601302350b62ab1dfcf9ba35e1
|
4
|
+
data.tar.gz: 940ea3dc4ae1abbdf0fac69e52d3b91b675fd19d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 73a6a4b5678ed1a78d89363a8f3dcf0c9e69522e67c8868b45f6620b615494c439619f36faa95b9e3c4a6de3da09733913a92c2f01ccc22ee8c0050c0a7d7c56
|
7
|
+
data.tar.gz: 62491db406792b5faabef96ab8e3e7713d17d10e82bfab7f6714a3c63f7c564c83849cd356cd3b3d6d1dbc83d894d1f3cfb768f408d774b974175f0d6cc4f4f0
|
data/README.mdown
CHANGED
@@ -56,7 +56,7 @@ For a rails application, it is recommanded to use following configuration into
|
|
56
56
|
|
57
57
|
```ruby
|
58
58
|
config.logger = ActiveSupport::Logger.new(SlackLogDevice.new(webhook_url: 'https://hooks.slack.com/services/...', username: 'MyRailsApp'))
|
59
|
-
config.logger.formatter = ::
|
59
|
+
config.logger.formatter = SlackLogDevice::FORMATTER
|
60
60
|
config.log_level = :warn
|
61
61
|
```
|
62
62
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.1
|
data/lib/slack_log_device.rb
CHANGED
@@ -13,7 +13,7 @@ class SlackLogDevice
|
|
13
13
|
if message.is_a?(Exception)
|
14
14
|
text << "A `#{message.class}` occurred: #{message.message}\n\n```"
|
15
15
|
backtrace = message.backtrace.join("\n")
|
16
|
-
backtrace = backtrace[0, MAX_MESSAGE_LENGTH -
|
16
|
+
backtrace = backtrace[0, MAX_MESSAGE_LENGTH - 6 - text.size] << "..." if backtrace.size > MAX_MESSAGE_LENGTH - 3
|
17
17
|
text << backtrace << '```'
|
18
18
|
else
|
19
19
|
text << message
|
@@ -42,7 +42,7 @@ describe SlackLogDevice do
|
|
42
42
|
exception.set_backtrace(['a' * 4500])
|
43
43
|
message = formatter.call('DEBUG', Time.now, 'My App', exception)
|
44
44
|
expect(message.size).to eq(4000)
|
45
|
-
expect(message).to end_with("aaaaaa
|
45
|
+
expect(message).to end_with("aaaaaa...```")
|
46
46
|
end
|
47
47
|
|
48
48
|
it 'can be exactly 4000 chars (without three dots)' do
|
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: 2.2.
|
4
|
+
version: 2.2.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-
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|