deprecation_helper 0.1.1 → 0.2.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5c2bd01471e901e6326714d6d1ffcaa70dbc26267de5f6021b99883362fec4c
|
4
|
+
data.tar.gz: d0b112c7b6ec7e9eb1145acaf0a25117a15e53804a5d074a7e63450aa20d4a6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e4ecf3d33aea3b9e769dac9b848100710777afd837d33181e1359590839d5da3965c8b58e97985c9be51927d4b495a8e743b99848f2d920a5139c9ef9cb41d1
|
7
|
+
data.tar.gz: b85eed3965943d92dfaa367ac08a8e5a2ec85476af53e43f36627a6dbc97d093d4990227439f2a2b0254d7bf68cd1d8825aac92f5d46c3cffd25f3043f7306ff
|
data/lib/deprecation_helper.rb
CHANGED
@@ -10,6 +10,7 @@ require 'deprecation_helper/strategies/base_strategy_interface'
|
|
10
10
|
require 'deprecation_helper/strategies/error_strategy_interface'
|
11
11
|
require 'deprecation_helper/strategies/raise_error'
|
12
12
|
require 'deprecation_helper/strategies/log_error'
|
13
|
+
require 'deprecation_helper/strategies/log_error_and_stacktrace'
|
13
14
|
|
14
15
|
require 'deprecation_helper/deprecation_exception'
|
15
16
|
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# typed: strict
|
2
|
+
|
3
|
+
module DeprecationHelper
|
4
|
+
module Strategies
|
5
|
+
class LogErrorAndStacktrace
|
6
|
+
include BaseStrategyInterface
|
7
|
+
|
8
|
+
extend T::Sig
|
9
|
+
|
10
|
+
sig { params(logger: T.nilable(Logger)).void }
|
11
|
+
def initialize(logger: nil)
|
12
|
+
@logger = T.let(logger || Logger.new(STDOUT), Logger)
|
13
|
+
end
|
14
|
+
|
15
|
+
sig { override.params(message: String, backtrace: T::Array[String]).void }
|
16
|
+
def apply!(message, backtrace) # rubocop:disable Lint/UnusedMethodArgument
|
17
|
+
@logger.warn({ message: message, backtrace: backtrace})
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deprecation_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Evanczuk
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sorbet-runtime
|
@@ -69,6 +69,7 @@ files:
|
|
69
69
|
- lib/deprecation_helper/strategies/base_strategy_interface.rb
|
70
70
|
- lib/deprecation_helper/strategies/error_strategy_interface.rb
|
71
71
|
- lib/deprecation_helper/strategies/log_error.rb
|
72
|
+
- lib/deprecation_helper/strategies/log_error_and_stacktrace.rb
|
72
73
|
- lib/deprecation_helper/strategies/raise_error.rb
|
73
74
|
homepage:
|
74
75
|
licenses: []
|