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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d42eee8929a0bb372234198aade127f4ea73bbf7315133d2f88e6e6caff69084
4
- data.tar.gz: f173c941c4ab3d54d54a85a6c53742bfd0dab1b7b6333920dbb0ffebdebe772e
3
+ metadata.gz: d658a3a17f04025bed6140c233857a95f2e153332654d3fe6fbc2c10d0ef7916
4
+ data.tar.gz: 2b73f21507f4fa1e2a18ec20bfe57d613abbee01b079ed1fc78f12f966623854
5
5
  SHA512:
6
- metadata.gz: 4d6f8d04d0f95eae97dd23450507d01e49afc7bfa82ec0a4d5a35db0ab06a38595e79f41a8f60f45f500bfc9dc5f0d3bc6dff77f446ad6c8d26bc42338a044b9
7
- data.tar.gz: '05872e41faae73675db913eff599a98ec497e2eaaa01335b5dcf8d54b3238e1a858d449667cfe415ec1ed17bafc38a88b9b1b4091e05e4c683ce2ab88b31e863'
6
+ metadata.gz: 1a8d7a403f777a0e2ddf846d7da980267d22b5d44665aed8e4794c851d5a92ce535a1e6e338cd100c4d1fe81eaa13290857ce4d44bddd557172aebd8803f1a23
7
+ data.tar.gz: c7b32c823fc0972a0039f4a2618671d8db045680b6b5b5158ba70c88bc06715b8fe0b431820cca705f0b28ebbc107171c097498da95d67ffa5814a9b8e2ca219
@@ -44,7 +44,7 @@ jobs:
44
44
  strategy:
45
45
  fail-fast: false
46
46
  matrix:
47
- ruby: [2.5, 2.6, 2.7]
47
+ ruby: [2.6, 2.7]
48
48
 
49
49
  steps:
50
50
  - uses: actions/checkout@v2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lamian (1.4.0)
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.10)
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.2.2)
239
- actionpack (>= 4.0)
240
- activesupport (>= 4.0)
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
@@ -13,5 +13,5 @@ module Lamian
13
13
  # According to this, it is enought to specify '~> a.b'
14
14
  # if private API was not used and to specify '~> a.b.c' if it was
15
15
 
16
- VERSION = "1.4.0"
16
+ VERSION = "1.5.0"
17
17
  end
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.0
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-01 00:00:00.000000000 Z
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.2.30
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