Skip to content

Commit 82eb403

Browse files
committed
use has_log_configuration
1 parent 3b8d7dc commit 82eb403

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/viam/sdk/config/resource.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,15 +155,16 @@ void to_proto_impl<ResourceConfig>::operator()(const ResourceConfig& self,
155155

156156
ResourceConfig from_proto_impl<app::v1::ComponentConfig>::operator()(
157157
const app::v1::ComponentConfig* proto) const {
158-
const std::string& level_str = proto->log_configuration().level();
159158
return ResourceConfig(proto->type(),
160159
proto->name(),
161160
proto->namespace_(),
162161
from_proto(proto->attributes()),
163162
proto->api(),
164163
Model::from_str(proto->model()),
165164
proto->has_frame() ? from_proto(proto->frame()) : LinkConfig{},
166-
level_str.empty() ? log_level::info : level_from_string(level_str));
165+
proto->has_log_configuration()
166+
? level_from_string(proto->log_configuration().level())
167+
: log_level::info);
167168
}
168169

169170
std::vector<ResourceConfig>

0 commit comments

Comments
 (0)