harryGuo133

Results 8 comments of harryGuo133

Yes, what I meant was rotation. To reproduce this scenario, it is necessary to write at a very high frequency. I created a log object using rotating_logger_mt function, and my...

yes ,the logger is Singleton pattern

This is how I use the logging library: { Logger() { // std::string log_filename = "logs/" + getLogFilename(); logger_ = spdlog::rotating_logger_mt("Logger", log_filename.c_str(), 1024 * 1024 * 10, 50); logger_->flush_on(spdlog::level::debug); std::string...

static Logger& getInstance() { static Logger instance; return instance; } The log object is accessed in a singleton mode. So there won't be the multiple creation problem you mentioned

> > 崩溃时,当前xxx.1 xxx.2 xxx.3等文件后,没有原来的xxx日志文件 > > 当下面的源代码报错时,就会出现这种情况。 > > https://github.com/gabime/spdlog/blob/57a9fd0841f00e92b478a07fef62636d7be612a8/include/spdlog/sinks/rotating_file_sink-inl.h#L124-L137 > > 在 Windows 中,由于某些原因(通常是杀毒软件),重命名可能会失败。 如果重命名失败,则重新打开日志文件,但如果这也被杀毒软件拦截,则`fd`变成`nullptr`. > > > 注意 > > `fd`是`nullptr`因为日志文件在重命名之前已关闭。 > > 在这种情况下,错误处理程序由 调用`throw`,因此您可以检查 的输出`STDERR`以查看您是否遇到此问题 (...

> I can't determine the cause of the problem, so I'm going to report the error handler. > > EDIT: File system problems are often reported in Windows OS, but...

I will locate the specific cause of the problem, we will contact later

I have also encountered this problem, after I bind the callback function triggers a direct crash Have you solved this problem?