-
Notifications
You must be signed in to change notification settings - Fork 3
feat: Add support for logging configuration. #88
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
| std::chrono::seconds{30})) | ||
| .WithReasons(true) | ||
| .UseReport(true)) | ||
| .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.
There are some implicit constructors to make setting the logging method simpler. Here there is a basic logging builder getting converted into a LoggingBuilder.
| #include <launchdarkly/config/client.hpp> | ||
| #include <launchdarkly/config/server.hpp> | ||
| #include "null_logger.hpp" | ||
| #include <launchdarkly/logging/null_logger.hpp> |
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.
Null logger is now used to disable logging. So it was moved to internal.
| private: | ||
| LogLevel level_; | ||
| std::string name_; | ||
| std::mutex write_mutex_; |
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.
Just to allow log entries not to overlap. If you want a high performance lock-free logger, then replace our logger.
| * @return Returns true if the level is enabled. | ||
| */ | ||
| virtual bool Enabled(LogLevel level) = 0; | ||
| virtual bool Enabled(LogLevel level) noexcept = 0; |
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.
Seemed like a good idea to make these noexcept.
Added support for configuring logging.
Did not add c-bindings yet.