-
Notifications
You must be signed in to change notification settings - Fork 299
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
[ESI][Runtime] Logging API #7569
Conversation
63e373b
to
2a854c3
Compare
The CI gate clang-format disagrees with clang-format-17... |
The ESI logging API is intended to be agnostic of the application's logging framework. In other words, it can be adapted to the application's logging method with ease -- users must only extend one class. It also comes with a simple text logger. It is also designed to enable debug logging in Release builds with (very) minimal performance overhead if the user does not set the log level to debug. This PR introduces the API, but doesn't use it much. More plumbing will be required to actually use it. In the interest of keeping this PR small, this is left for future work.
2a854c3
to
e6d0177
Compare
|
||
using namespace esi; | ||
|
||
// Necessary in some versions of the c++ standard library to avoid warnings |
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.
@mortbopet I think this is true, but I find it quite unusual... am I doing something wrong?
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.
This is the first time i've seen this pattern, so 🤷.
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.
I generally like the structure. However, I think it would be a nice-to-have (and possibly need-to-have) if we can register multiple loggers (somewhat as what one can do in spdlog). This PR wouldn't change that much, you'd just have to:
- iterate through all registered loggers in the
log(...)
function - Not create the null logger by default
This is super useful in situations where a runtime wants to be in control of it's own (internal) logging implementation, but also need to expose a logging interface externally, to users of the runtime.
|
||
using namespace esi; | ||
|
||
// Necessary in some versions of the c++ standard library to avoid warnings |
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.
This is the first time i've seen this pattern, so 🤷.
This would introduce some performance issues, which I'm ultra concerned about given that I want debug level logging to have the capability to log individual messages. Checking the |
Merged (& will rely on post-merge comments) so I can cut releases for both PyCDE and ESIRuntime. |
The ESI logging API is intended to be agnostic of the application's logging framework. In other words, it can be adapted to the application's logging method with ease -- users must only extend one class. It also comes with a simple text logger.
It is also designed to enable debug logging in Release builds with (very) minimal performance overhead if the user does not set the log level to debug.
This PR introduces the API, but doesn't use it much. More plumbing will be required to actually use it. In the interest of keeping this PR small, this is left for future work.