-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Prefer use logging in butil or glog? #2696
Comments
I currently use I have plans to support log rotation in |
I just finish exporting some wait-free & malloc-free async logger practice used internal in baidu [documented here]. Integrate these to LOG macro leaves a disaster of tricks internal. If there is a plan of making a new framework, i think maybe we could make some proper plugin point to let the integration easier. |
What are the problems with the integration through |
|
Make LogStream a virtual base class as follows: class LogStream : public std::ostream {
LogStream(std::streambuf* streambuf) : std::ostream(&streambuf) {}
virtual void SetSourceLocation(const SourceLocation& sl) = 0;
virtual void Flush() = 0;
} At the same time, a class LogStreamFactory {
virtual LogStream* Create() = 0;
virtual void Destroy(LogStream* log_stream) = 0;
}; Is this design feasible? |
Good enough for me. I have a similar design here. A std::streambuf plugin point is easier to do the integration |
👍🏻 |
Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)
I see there is a simple logging mechanism delivered along with brpc in butil/logging.cc. I'm not sure whether it is aimed to be production ready or just a default demo. It lack some important feature, like rotation. But on the other hand, i see @chenBright is still try to optimize it for performance month ago.
Describe the solution you'd like (描述你期望的解决方法)
I want to know, whether a logging implementation is in brpc's road map, or we just depend on glog's ecosystem?
Describe alternatives you've considered (描述你想到的折衷方案)
Additional context/screenshots (更多上下文/截图)
The text was updated successfully, but these errors were encountered: