Skip to content
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

Explicitly set line buffered mode #28

Merged
merged 1 commit into from
Mar 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions desktop/root_canal_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <fstream>
#include <future>
#include <optional>
#include <cstdio>

#include "model/setup/async_manager.h"
#include "net/posix/posix_async_socket_connector.h"
Expand Down Expand Up @@ -54,6 +55,10 @@ DEFINE_uint32(link_port, 6403, "link server tcp port");
DEFINE_uint32(link_ble_port, 6404, "le link server tcp port");

int main(int argc, char** argv) {
// always use line buffer mode so log messages are available when redirected
setvbuf(stdout, NULL, _IOLBF, 0);
setvbuf(stderr, NULL, _IOLBF, 0);

gflags::ParseCommandLineFlags(&argc, &argv, true);
rootcanal::log::SetLogColorEnable(FLAGS_enable_log_color);

Expand Down
Loading