-
Notifications
You must be signed in to change notification settings - Fork 3
feat: implement remaining config C bindings #90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
This pull request has been linked to Shortcut Story #201468: Create C bindings for Config type. |
d8a75eb to
2851d49
Compare
| .WithReasons(true) | ||
| .UseReport(true); | ||
| config_builder.Logging().Logging( | ||
| LoggingBuilder::BasicLogging().Level(LogLevel::kDebug)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably slightly improve this by adding Basic()/Custom() members to the logging builder, so it's not Logging().Logging. Hmm
| #include <launchdarkly/bindings/c/status.h> | ||
|
|
||
| #include <stdio.h> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For size_t.
| * severity. | ||
| * severity. The values must not be changed to ensure backwards compatibility | ||
| * with the C API. | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could use a switch instead of static_cast. It's just annoying.
| std::map<std::string, std::string>{{"color", "green"}})); | ||
| builder.HttpProperties() | ||
| .ConnectTimeout(std::chrono::milliseconds{1234}) | ||
| .ReadTimeout(std::chrono::milliseconds{123456}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WriteTimeout?
One thing of note is probably the custom logging backend. This is a struct with a couple of function pointers + user data void pointer.
I've provided a wrapper that converts that into an
ILogBackend.Aside from that, everything else is mostly straightforward.