You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The standard Go log package is used by default to show error logs.
175
-
This can be overridden using the structured logging, [logr](https://github.com/go-logr/logr) API, allowing integration to any package.
176
-
There are already [integration implementations](https://github.com/go-logr/logr#implementations-non-exhaustive) for many of the popular logger packages.
174
+
Note that in accordance with the OpenFeature specification, the SDK doesn't generally log messages during flag evaluation.
175
+
176
+
#### Logging Hook
177
+
178
+
The GO SDK includes a `LoggingHook`, which logs detailed information at key points during flag evaluation, using [slog](https://pkg.go.dev/log/slog) structured logging API.
179
+
This hook can be particularly helpful for troubleshooting and debugging; simply attach it at the global, client or invocation level and ensure your log level is set to "debug".
180
+
181
+
##### Usage example
177
182
178
183
```go
179
-
varl logr.Logger
180
-
l = integratedlogr.New() // replace with your chosen integrator
{"time":"2024-10-23T13:33:09.8968242+03:00","level":"ERROR","msg":"Error stage","domain":"test-client","provider_name":"InMemoryProvider","flag_key":"not-exist","default_value":true,"error_message":"error code: FLAG_NOT_FOUND: flag for key not-exist not found"}
207
+
```
208
+
209
+
See [hooks](#hooks) for more information on configuring hooks.
189
210
190
211
### Domains
191
-
Clients can be assigned to a domain. A domain is a logical identifier which can be used to associate clients with a particular provider. If a domain has no associated provider, the default provider is used.
212
+
213
+
Clients can be assigned to a domain. A domain is a logical identifier that can be used to associate clients with a particular provider. If a domain has no associated provider, the default provider is used.
0 commit comments