Page MenuHomePhabricator

D4590.id14972.diff
No OneTemporary

D4590.id14972.diff

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 <glog/logging.h>
+
#include <iostream>
#include <memory>
@@ -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 <glog/logging.h>
#include <grpcpp/grpcpp.h>
#include <iostream>
@@ -18,7 +21,7 @@
builder.AddListeningPort(server_address, grpc::InsecureServerCredentials());
builder.RegisterService(&blobService);
std::unique_ptr<grpc::Server> 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;

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 18, 11:21 PM (21 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2535920
Default Alt Text
D4590.id14972.diff (1 KB)

Event Timeline