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 evaluation context **SHOULD** only be logged if an associated option indicates so.
378
+
379
+
This can be a constructor option or similar, for example: `boolean printContext`.
380
+
381
+
> If logging the evaluation context is enabled, it **MUST** be printed in such a way that it's human readable.
382
+
383
+
Consider printing the evaluation context as a stringified JSON object, or using some other format that allows the nested properties to be easily read.
384
+
385
+
> If the logger abstraction in the SDK supports a log level concept, the appropriate log level **SHOULD** be used for each stage (before/after: debug/info, error: error).
386
+
387
+
Consider using `debug` or `info` levels for the `before` and `after` stages, and the `error` level for the `error` stage.
Copy file name to clipboardExpand all lines: specification/sections/01-flag-evaluation.md
+8-2Lines changed: 8 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -353,9 +353,15 @@ Configuration code includes code to set the provider, instantiate providers, and
353
353
354
354
#### Requirement 1.4.11
355
355
356
-
> In the case of abnormal execution, the client **SHOULD** log an informative error message.
356
+
> Methods, functions, or operations on the client **SHOULD NOT**write log messages.
357
357
358
-
Implementations may define a standard logging interface that can be supplied as an optional argument to the client creation function, which may wrap standard logging functionality of the implementation language.
358
+
The client methods (particularly the evaluation methods) run in hot code paths.
359
+
Logging (even at error level) can cause a huge volume of log entries.
360
+
For example, in a circumstance in which an application expecting a particular flag to exist is deployed in advance of that flag's being defined in the management system, logs can become inundated with `FLAG_NOT_FOUND` messages and related stack traces.
361
+
Logging in these code paths is highly discouraged.
362
+
Application authors can attach a [logging hook](../appendix-a-included-utilities.md#logging-hook) or author their own custom logging hook(s) to help with debugging or satisfy their particular logging needs.
363
+
364
+
Logging is encouraged in functions to do with configuration, initialization, shutdown, etc.
0 commit comments