Replies: 2 comments
-
muduo异步日志模块,后端默认是3秒flush一次,快速启动后退出,日志消息还在FixedBuffer中,没有flush到内核缓存/磁盘。 如果要解决这个问题,可以在进程退出前,主动flush一次。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
GitHub issues are for tracking bugs, not for general discussing like a forum.
If you have a general question to ask, send it to mailing list:
[email protected]
Or visit:
https://groups.google.com/forum/#!forum/muduo-library
When file an issue muduo, please provide a SSCCE:
Short, Self Contained, Correct (Compilable), Example.
Also specify the exact environment where the issue occurs:
Linux distro and version? x86 or ARM? 32-bit or 64-bit?
Branch (cpp98/cpp11/cpp17) and version of muduo?
Version of cmake, gcc and boost? (If not from distro.)
muduo::AsyncLogging* log_g;
void GWOutputFunc(const char* msg, int len)
{
log_g->append(msg, len);
}
void GWLogFlush()
{
log_g->stop();
}
bool GWEngine::InitLog()
{
char *path = getenv("HOME");
char name[256] = { 0 };
sprintf(name, "%s/log", path);
}
程序启动后很快退出,异步日志AsyncLogging无法打印日志到文件,这个是啥原因啊?
Beta Was this translation helpful? Give feedback.
All reactions