-
Notifications
You must be signed in to change notification settings - Fork 23
RSDK-10579: Robot client update #425
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
Changes from all commits
e71af6e
8653759
1d4b1b6
881ea2a
68d7a9f
f1cd2f3
52eab57
0f8c575
fc95c99
ae3bac7
e6e489a
c89c7f4
0e2bb78
cf3a49f
da78755
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,11 +133,15 @@ void LogManager::init_logging() { | |
console_sink_ = boost::make_shared< | ||
boost::log::sinks::synchronous_sink<boost::log::sinks::text_ostream_backend>>(backend); | ||
|
||
console_sink_->set_filter(Filter{this}); | ||
boost::log::core::get()->add_sink(console_sink_); | ||
|
||
console_sink_->set_formatter(fmt); | ||
enable_console_logging(); | ||
} | ||
|
||
boost::log::core::get()->add_sink(console_sink_); | ||
VIAM_SDK_LOG(debug) << "Initialized console logging"; | ||
void LogManager::enable_console_logging() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't really follow the logging changes too closely, so apologies if this is covering old ground, but what are the safety / concurrency guarantees around enabling and disabling console logging? If I have many RobotClient's coming into and out of existence in multiple threads, does it work right? It looks like the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That's right. It's a narrow window, and might all just happen with the
Paraphrasing a discussion with @stuqdog , and I'm going to add a bunch of explanatory comments about this stuff. But basically the key is that non-default destruction in
so under all these hypotheses, we can say that uniqueness and non-concurrency is guaranteed, and that the in-and-out-of-existence multiple threads thing can't happen in this case |
||
console_sink_->set_filter(Filter{this}); | ||
VIAM_SDK_LOG(debug) << "Console logging enabled"; | ||
} | ||
|
||
void LogManager::disable_console_logging() { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cert warning is funny. If you make it a template with a parameter pack instead, I assume that doesn't work because it breaks the overload resolution / template instantiation balance that you are leveraging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly! a variadic is always considered the worst/last choice for overload resolution so it's needed in this case