-
Notifications
You must be signed in to change notification settings - Fork 23
RSDK-5986: Resource-level logging for the C++ SDK #383
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
base: main
Are you sure you want to change the base?
Changes from 66 commits
31437c3
932ebaa
04d0158
a105cef
403f316
27eeb13
ce2aa8c
e5cf6d0
85194da
5024d3a
ef8ec8e
16113fd
216e5e2
dbf1647
d1dffb8
4771390
18d26c9
6018323
d4aeb86
5535616
4d2582c
eeac195
7560f6d
af08403
4e25d35
55baa6c
10cd711
c745422
75ab450
fc21c35
1758ee9
cd1d8c5
679f1b6
795578c
1b88d1c
5eb243b
6e311bc
f84fe6e
9311990
a09901f
f9b1cb3
68add9d
05eddd0
5debae1
6866567
6e154ce
f02ce0f
e80bf80
185121a
7a747ec
9c4dc97
30fe47e
7409dc7
7fafee8
0dbd491
c67166b
0745e16
04edd0d
537ea67
56e706c
818825a
6d43bbd
de5e33a
a286508
587d1f6
e45bafc
14a6049
216df1d
f4b0f11
e3e2697
bdebbab
6755cd6
8c372cc
1744939
d7842c1
9829e44
e10df01
192b29f
2de9f40
d681f6f
3b8d7dc
82eb403
ad079c8
6b83aed
f9f39a1
4eb8643
418f882
ee85b28
40b5400
22d29e3
ba154d1
2e9d015
b8dcf7c
f6c21ff
ac25b4e
04c92ce
9297062
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 |
---|---|---|
|
@@ -26,14 +26,16 @@ ResourceConfig::ResourceConfig(std::string type, | |
ProtoStruct attributes, | ||
std::string api, | ||
Model model, | ||
LinkConfig frame) | ||
LinkConfig frame, | ||
sdk::log_level lvl) | ||
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. (q) do we need 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. I think not anymore, initially the getter was also called |
||
: api_({kRDK, type, ""}), | ||
frame_(std::move(frame)), | ||
model_(std::move(model)), | ||
name_(std::move(name)), | ||
namespace__(std::move(namespace_)), | ||
type_(std::move(type)), | ||
attributes_(std::move(attributes)) { | ||
attributes_(std::move(attributes)), | ||
log_level_(lvl) { | ||
if (api.find(':') != std::string::npos) { | ||
api_ = API::from_string(std::move(api)); | ||
} | ||
|
@@ -81,6 +83,10 @@ const std::string& ResourceConfig::type() const { | |
return type_; | ||
} | ||
|
||
log_level ResourceConfig::get_log_level() const { | ||
return log_level_; | ||
} | ||
|
||
const std::vector<std::string>& viam::sdk::ResourceConfig::depends_on() const { | ||
return depends_on_; | ||
} | ||
|
@@ -137,6 +143,7 @@ void to_proto_impl<ResourceConfig>::operator()(const ResourceConfig& self, | |
*proto->mutable_namespace_() = self.namespace_(); | ||
*proto->mutable_type() = self.type(); | ||
*proto->mutable_api() = self.api().to_string(); | ||
*proto->mutable_log_configuration()->mutable_level() = to_string(self.get_log_level()); | ||
*proto->mutable_model() = self.model().to_string(); | ||
*proto->mutable_attributes() = to_proto(self.attributes()); | ||
|
||
|
@@ -154,7 +161,8 @@ ResourceConfig from_proto_impl<app::v1::ComponentConfig>::operator()( | |
from_proto(proto->attributes()), | ||
proto->api(), | ||
Model::from_str(proto->model()), | ||
proto->has_frame() ? from_proto(proto->frame()) : LinkConfig{}); | ||
proto->has_frame() ? from_proto(proto->frame()) : LinkConfig{}, | ||
level_from_string(proto->log_configuration().level())); | ||
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. (minor) maybe a little paranoid, but edit: I see you updated here already, disregard! 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. Actually ended up fixing this due to your suggestion to paste some sample logs because I saw an error that kept firing! But it's helpful to know about |
||
} | ||
|
||
std::vector<ResourceConfig> | ||
|
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.
this was a drive-by