-
Notifications
You must be signed in to change notification settings - Fork 36
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
Log Cache #119
Comments
By default, if the environment variable RCL_LOGGING_SPDLOG_EXPERIMENTAL_OLD_FLUSHING_BEHAVIOR is not set, the default flush time is 5 seconds. Setting this environment variable uses the old default value, which maybe 3 seconds. Currently, no interface is provided to specify flush time from the outside. So, you can only modify the code yourself. Besides changing the flush time, you can also modify the BTW, frequent file writing is generally not recommended. rcl_logging/rcl_logging_spdlog/src/rcl_logging_spdlog.cpp Lines 197 to 207 in 7529e87
auto sink = std::make_unique<spdlog::sinks::basic_file_sink_mt>(name_buffer, false);
g_root_logger = std::make_shared<spdlog::logger>("root", std::move(sink));
if (!should_use_old_flushing_behavior) {
// in this case we should do the new thing (until config files are supported)
// which is to configure the logger to flush periodically and on
// error level messages
spdlog::flush_every(std::chrono::seconds(5));
g_root_logger->flush_on(spdlog::level::err);
} else {
// the old behavior is to not configure the sink at all, so do nothing
} |
@Barry-Xu-2018 @CTGUMARK i moved this issue to |
After the program is started, the log size is 0. It will not be written to the log until the program is closed. Is there a cache mechanism? Will it be written to the log file only when it reaches a certain size? How to write in real time
The text was updated successfully, but these errors were encountered: