You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto logger = spdlog::get("basic_logger");
if (NULL == logger)
{
std::cout << "get logger error." << std::endl;
}
int i = 0;
while (i < 10)
{
logger->info("This is basic_logger .");
Sleep(1000);
i++;
}
}
=======Dividing line=========
The above is a log test program output to a file. After the first run, the printed content appears correctly in the log file, but it does not appear to be updated during the second run. In fact, the file generated during the first run should be overwritten during the second run. What we expect is not to overwrite the file. How can we solve this problem? Other file longers also have the same problem...
The text was updated successfully, but these errors were encountered:
#include <stdlib.h>
#include
#include "spdlog/spdlog.h"
#include "spdlog/sinks/basic_file_sink.h"
int main()
{
try
{
spdlog::basic_logger_mt("basic_logger", "logs/basic-log.log");
}
catch (const spdlog::spdlog_ex& ex)
{
std::cout << "Log init failed: " << ex.what() << std::endl;
}
}
=======Dividing line=========
The above is a log test program output to a file. After the first run, the printed content appears correctly in the log file, but it does not appear to be updated during the second run. In fact, the file generated during the first run should be overwritten during the second run. What we expect is not to overwrite the file. How can we solve this problem? Other file longers also have the same problem...
The text was updated successfully, but these errors were encountered: