44
55#include < google/protobuf/descriptor.h>
66
7+ #include < boost/log/common.hpp>
8+ #include < boost/log/sources/logger.hpp>
9+ #include < boost/log/trivial.hpp>
710#include < viam/sdk/common/client_helper.hpp>
811#include < viam/sdk/common/utils.hpp>
912#include < viam/sdk/registry/registry.hpp>
@@ -24,12 +27,22 @@ API API::traits<Gizmo>::api() {
2427 return {" viam" , " component" , " gizmo" };
2528}
2629
27- Gizmo::Gizmo (std::string name) : Component(std::move(name)){};
30+ Gizmo::Gizmo (std::string name)
31+ : Component(std::move(name)) {
32+ // boost::log::sources::severity_logger<boost::log::trivial::severity_level> lg;
33+ // BOOST_LOG_SEV(lg, boost::log::trivial::severity_level::debug) << "debug test";
34+ // BOOST_LOG_SEV(lg, boost::log::trivial::severity_level::info) << "info test";
35+ // BOOST_LOG_SEV(lg, boost::log::trivial::severity_level::warning) << "warning test";
36+ // BOOST_LOG_SEV(lg, boost::log::trivial::severity_level::error) << "error test";
37+ // BOOST_LOG_TRIVIAL(error) << "gizmo created error\n";
38+ // BOOST_LOG_TRIVIAL(info) << "gizmo created info\n";
39+ // BOOST_LOG_TRIVIAL(debug) << "gizmo created debug\n";
40+ };
2841
2942/* Gizmo server methods */
3043
3144GizmoServer::GizmoServer (std::shared_ptr<ResourceManager> manager)
32- : ResourceServer(std::move(manager)){};
45+ : ResourceServer(std::move(manager)) {};
3346
3447grpc::Status GizmoServer::DoOne (grpc::ServerContext* context,
3548 const DoOneRequest* request,
@@ -170,12 +183,25 @@ grpc::Status GizmoServer::DoTwo(::grpc::ServerContext* context,
170183/* Gizmo client methods */
171184
172185GizmoClient::GizmoClient (std::string name, std::shared_ptr<grpc::Channel> channel)
173- : Gizmo(std::move(name)), stub_(GizmoService::NewStub(channel)), channel_(std::move(channel)){};
186+ : Gizmo(std::move(name)),
187+ stub_(GizmoService::NewStub(channel)),
188+ channel_(std::move(channel)) {};
174189
175190bool GizmoClient::do_one (std::string arg1) {
191+ BOOST_LOG_SEV (*(logger_.underlying ()), boost::log::trivial::severity_level::error)
192+ << " some other new error log" ;
193+ logger_.info (" new info log" );
194+ logger_.debug (" new debug log" );
195+ logger_.error (" new error log" );
176196 return make_client_helper (this , *stub_, &StubType::DoOne)
177- .with ([&](auto & request) { request.set_arg1 (arg1); })
178- .invoke ([](auto & response) { return response.ret1 (); });
197+ .with ([&](auto & request) {
198+ std::cout << " in with\n " << std::flush;
199+ request.set_arg1 (arg1);
200+ })
201+ .invoke ([](auto & response) {
202+ std::cout << " in invoke\n " << std::flush;
203+ return response.ret1 ();
204+ });
179205}
180206
181207bool GizmoClient::do_one_client_stream (std::vector<std::string> arg1) {
0 commit comments