lamian 1.4.0 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +1 -1
- data/Gemfile.lock +5 -5
- data/README.md +10 -0
- data/lib/lamian/sentry_scope_patch.rb +17 -0
- data/lib/lamian/version.rb +1 -1
- data/lib/lamian.rb +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d658a3a17f04025bed6140c233857a95f2e153332654d3fe6fbc2c10d0ef7916
|
4
|
+
data.tar.gz: 2b73f21507f4fa1e2a18ec20bfe57d613abbee01b079ed1fc78f12f966623854
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a8d7a403f777a0e2ddf846d7da980267d22b5d44665aed8e4794c851d5a92ce535a1e6e338cd100c4d1fe81eaa13290857ce4d44bddd557172aebd8803f1a23
|
7
|
+
data.tar.gz: c7b32c823fc0972a0039f4a2618671d8db045680b6b5b5158ba70c88bc06715b8fe0b431820cca705f0b28ebbc107171c097498da95d67ffa5814a9b8e2ca219
|
data/.github/workflows/test.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lamian (1.
|
4
|
+
lamian (1.5.0)
|
5
5
|
rails (>= 4.2)
|
6
6
|
|
7
7
|
GEM
|
@@ -106,7 +106,7 @@ GEM
|
|
106
106
|
faraday-rack (1.0.0)
|
107
107
|
globalid (0.5.2)
|
108
108
|
activesupport (>= 5.0)
|
109
|
-
i18n (1.8.
|
109
|
+
i18n (1.8.11)
|
110
110
|
concurrent-ruby (~> 1.0)
|
111
111
|
launchy (2.5.0)
|
112
112
|
addressable (~> 2.7)
|
@@ -235,9 +235,9 @@ GEM
|
|
235
235
|
sprockets (4.0.2)
|
236
236
|
concurrent-ruby (~> 1.0)
|
237
237
|
rack (> 1, < 3)
|
238
|
-
sprockets-rails (3.
|
239
|
-
actionpack (>=
|
240
|
-
activesupport (>=
|
238
|
+
sprockets-rails (3.4.0)
|
239
|
+
actionpack (>= 5.2)
|
240
|
+
activesupport (>= 5.2)
|
241
241
|
sprockets (>= 3.0.0)
|
242
242
|
symbiont-ruby (0.7.0)
|
243
243
|
thor (1.1.0)
|
data/README.md
CHANGED
@@ -47,6 +47,16 @@ You should add Lamian appender to the SematicLogger appenders like this:
|
|
47
47
|
SemanticLogger.add_appender(appender: Lamian::SemanticLoggerAppender.new)
|
48
48
|
```
|
49
49
|
|
50
|
+
### Patching Sentry Scope
|
51
|
+
|
52
|
+
If you want to send events asynchronously you need to patch `Sentry::Scope`.
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
# Somewhere in a initializer.
|
56
|
+
|
57
|
+
Sentry::Scope.prepend(Lamian::SentryScopePatch)
|
58
|
+
```
|
59
|
+
|
50
60
|
## Raven (deprecated)
|
51
61
|
|
52
62
|
### Usage
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Lamian
|
4
|
+
# Patch for the `Sentry::Scope`. Extends the attribute accessor
|
5
|
+
# by adding an automatic lamian log dump.
|
6
|
+
# You should use this patch if you want to asynchronously send events.
|
7
|
+
# @example Prepending `Sentry::Scope` class
|
8
|
+
# Sentry::Scope.prepend(Lamian::SentryScopePatch) #=> Sentry::Scope
|
9
|
+
module SentryScopePatch
|
10
|
+
# Extra data defined in the scope.
|
11
|
+
# @return [String]
|
12
|
+
def extra
|
13
|
+
log = Lamian.dump(format: :txt)&.slice(0, Lamian.config.raven_log_size_limit)
|
14
|
+
log ? super.merge!(Lamian::SENTRY_EXTRA_KEY => log) : super
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
data/lib/lamian/version.rb
CHANGED
data/lib/lamian.rb
CHANGED
@@ -14,6 +14,7 @@ module Lamian
|
|
14
14
|
autoload :SidekiqRavenMiddleware, "lamian/sidekiq_raven_middleware"
|
15
15
|
autoload :SidekiqSentryMiddleware, "lamian/sidekiq_sentry_middleware"
|
16
16
|
autoload :SemanticLoggerAppender, "lamian/semantic_logger_appender"
|
17
|
+
autoload :SentryScopePatch, "lamian/sentry_scope_patch"
|
17
18
|
|
18
19
|
# The key under which logs are stored in the Sentry extra data.
|
19
20
|
SENTRY_EXTRA_KEY = :lamian_log
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lamian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JelF
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- lib/lamian/rails_views/exception_notifier/_request_log.text.erb
|
238
238
|
- lib/lamian/raven_context_extension.rb
|
239
239
|
- lib/lamian/semantic_logger_appender.rb
|
240
|
+
- lib/lamian/sentry_scope_patch.rb
|
240
241
|
- lib/lamian/sidekiq_raven_middleware.rb
|
241
242
|
- lib/lamian/sidekiq_sentry_middleware.rb
|
242
243
|
- lib/lamian/version.rb
|
@@ -259,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
259
260
|
- !ruby/object:Gem::Version
|
260
261
|
version: '0'
|
261
262
|
requirements: []
|
262
|
-
rubygems_version: 3.
|
263
|
+
rubygems_version: 3.3.0.dev
|
263
264
|
signing_key:
|
264
265
|
specification_version: 4
|
265
266
|
summary: Add logs to your error messages
|