diff --git a/services/blob/src/BlobServiceImpl.cpp b/services/blob/src/BlobServiceImpl.cpp --- a/services/blob/src/BlobServiceImpl.cpp +++ b/services/blob/src/BlobServiceImpl.cpp @@ -9,6 +9,8 @@ #include "GetReactor.h" #include "PutReactor.h" +#include + #include #include @@ -90,7 +92,7 @@ database::DatabaseManager::getInstance().removeBlobItem(blobHash); } } catch (std::runtime_error &e) { - std::cout << "error: " << e.what() << std::endl; + LOG(ERROR) << e.what(); status = grpc::Status(grpc::StatusCode::INTERNAL, e.what()); } auto *reactor = context->DefaultReactor(); diff --git a/services/blob/src/server.cpp b/services/blob/src/server.cpp --- a/services/blob/src/server.cpp +++ b/services/blob/src/server.cpp @@ -1,5 +1,8 @@ #include "BlobServiceImpl.h" +#include "GlobalTools.h" + +#include #include #include @@ -18,7 +21,7 @@ builder.AddListeningPort(server_address, grpc::InsecureServerCredentials()); builder.RegisterService(&blobService); std::unique_ptr server(builder.BuildAndStart()); - std::cout << "Server listening" << std::endl; + LOG(INFO) << "Server listening"; server->Wait(); } @@ -27,6 +30,7 @@ } // namespace comm int main(int argc, char **argv) { + comm::network::tools::InitLogging("blob"); comm::network::RunServer(); return 0;