traces 0.14.0 → 0.14.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
  SHA256:
3
- metadata.gz: 618c28f794dbd7fa30d3d211b50bb81a4bf785d8877f4512379d1f9bfc588032
4
- data.tar.gz: 0e7dcc6c4e0f88a1721a06cf4225093d9375a15cfc2bf09ec3aa67e16448453b
3
+ metadata.gz: 8026283fe7d321e24324a4672e7aaf8575897c066364b44bda087c9801815647
4
+ data.tar.gz: 6debcfc4f4ca487fe30c0e704c771bf50c56cfa7df6ee512d94fbe9e865a3560
5
5
  SHA512:
6
- metadata.gz: 8cf0fe5b427eca45083760ea6e5428f6b9a36ec00019ca55e4b505cd0edddd72c10c5d52fdca990a8e7676652cd72529f2f25a29298351625210702a9eb6111d
7
- data.tar.gz: fe0a03d14440673a637843065cb48ff9a54be1c315e5c08b0117875e0b42642e268b6b087d2cb4d5f541abc6085aaf589fb23650eacffdd5f137abd90cf9c321
6
+ metadata.gz: 55987e8c56f6b60f8985d9682b1d262b06b1badce6cf6d17a2aea5e27a9bafc8bc75c8385b0c1a7d91f67e9e6f23d9a518d082c57c77b47ac0d4a8c2ba206210
7
+ data.tar.gz: f4dd535ff8dbcfecc3a1fe2c79a5f32a77aaa643751ac337975af98d2e8f6a5f331433281ebea851e4f2705730dc4fa8ba2e8ca02d11f50b843b3fb11ca7a1cf
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/traces/config.rb CHANGED
@@ -38,12 +38,10 @@ module Traces
38
38
  if require(backend)
39
39
  Traces.extend(Backend::Interface)
40
40
 
41
- self.prepare
42
-
43
41
  return true
44
42
  end
45
43
  rescue LoadError => error
46
- ::Console::Event::Failure.for(error).emit(self, "Unable to load traces backend!", backend: backend, severity: :warn)
44
+ warn "Unable to load traces backend: #{backend.inspect}!"
47
45
  end
48
46
  end
49
47
 
@@ -36,6 +36,8 @@ module Traces
36
36
 
37
37
  return provider
38
38
  end
39
+
40
+ Config::DEFAULT.prepare
39
41
  else
40
42
  def self.Provider(klass, &block)
41
43
  # Tracing disabled.
@@ -4,5 +4,5 @@
4
4
  # Copyright, 2021-2023, by Samuel Williams.
5
5
 
6
6
  module Traces
7
- VERSION = "0.14.0"
7
+ VERSION = "0.14.1"
8
8
  end
data/readme.md CHANGED
@@ -25,7 +25,7 @@ Please see the [project releases](https://socketry.github.io/traces/releases/ind
25
25
 
26
26
  ### v0.14.0
27
27
 
28
- - [Introduce `Traces::Config` to control tracing behavior](https://socketry.github.io/traces/releases/index#introduce-traces::config-to-control-tracing-behavior)
28
+ - [Introduce `Traces::Config` to Expose `prepare` Hook](https://socketry.github.io/traces/releases/index#introduce-traces::config-to-expose-prepare-hook)
29
29
 
30
30
  ## Contributing
31
31
 
data/releases.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  ## v0.14.0
4
4
 
5
- ### Introduce `Traces::Config` to control tracing behavior
5
+ ### Introduce `Traces::Config` to Expose `prepare` Hook
6
6
 
7
- There are some reasonable defaults for tracing, but sometimes you want to change them. Adding a `config/traces.rb` file to your project will allow you to do that.
7
+ The `traces` gem uses aspect-oriented programming to wrap existing methods to emit traces. However, while there are some reasonable defaults for emitting traces, it can be useful to customize the behavior and level of detail. To that end, the `traces` gem now optionally loads a `config/traces.rb` which includes a `prepare` hook that can be used to load additional providers.
8
8
 
9
9
  ``` ruby
10
10
  # config/traces.rb
@@ -15,4 +15,4 @@ def prepare
15
15
  end
16
16
  ```
17
17
 
18
- The `prepare` method is called before the tracing is started but after the backend is required. You can require any provider you want in this file, or even add your own custom providers.
18
+ The `prepare` method is called immediately after the traces backend is loaded. You can require any provider you want in this file, or even add your own custom providers.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traces
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file