open-feature / spec

OpenFeature specification
https://openfeature.dev
Apache License 2.0
755 stars 36 forks source link

feat: logging requirements and logging hook #269

Closed toddbaert closed 2 months ago

toddbaert commented 2 months ago

As discussed in recent meetings, we've had complaints about this from multiple sources. This PR adds a stipulation that no logging is done by the SDK during flag evaluation. It also defines a very simple logging hook concept as an included utility. These should be very simple to write and will provide all the needed logging but give authors more control than built in log statements. It will also be a very nice intro to the hooks concept for users.

Here's the Java implementation: https://github.com/open-feature/java-sdk/pull/1084

toddbaert commented 2 months ago

LGTM. I have a minor question. With this spec change, will the LogHook become part of the SDK and should it be moved to the SDK repo?

Yep! I've implemented one in Java now here: https://github.com/open-feature/java-sdk/pull/1084

A LoggingHook should have no additional dependencies and is generally valuable, so the idea is they will be included in the SDK just like the in-memory providers.