Page MenuHomePhabricator

D4588.id14767.diff
No OneTemporary

D4588.id14767.diff

diff --git a/services/lib/src/GlobalTools.h b/services/lib/src/GlobalTools.h
--- a/services/lib/src/GlobalTools.h
+++ b/services/lib/src/GlobalTools.h
@@ -21,6 +21,8 @@
bool validateUUIDv4(const std::string &uuid);
+void InitLogging(const std::string &programName);
+
} // namespace tools
} // namespace network
} // namespace comm
diff --git a/services/lib/src/GlobalTools.cpp b/services/lib/src/GlobalTools.cpp
--- a/services/lib/src/GlobalTools.cpp
+++ b/services/lib/src/GlobalTools.cpp
@@ -57,6 +57,18 @@
}
}
+void InitLogging(const std::string &programName) {
+ FLAGS_logtostderr = true;
+ FLAGS_colorlogtostderr = true;
+ if (comm::network::tools::isSandbox()) {
+ // Log levels INFO, WARNING, ERROR, FATAL are 0, 1, 2, 3, respectively
+ FLAGS_minloglevel = 0;
+ } else {
+ FLAGS_minloglevel = 1;
+ }
+ google::InitGoogleLogging(programName.c_str());
+}
+
} // namespace tools
} // namespace network
} // namespace comm
diff --git a/services/tunnelbroker/src/server.cpp b/services/tunnelbroker/src/server.cpp
--- a/services/tunnelbroker/src/server.cpp
+++ b/services/tunnelbroker/src/server.cpp
@@ -35,23 +35,11 @@
AmqpManager::getInstance().connect();
}
-void InitLogging(const char *programName) {
- FLAGS_logtostderr = true;
- FLAGS_colorlogtostderr = true;
- if (comm::network::tools::isSandbox()) {
- // Log levels INFO, WARNING, ERROR, FATAL are 0, 1, 2, 3, respectively
- FLAGS_minloglevel = 0;
- } else {
- FLAGS_minloglevel = 1;
- }
- google::InitGoogleLogging(programName);
-}
-
} // namespace network
} // namespace comm
int main(int argc, char **argv) {
- comm::network::InitLogging(argv[0]);
+ comm::network::tools::InitLogging("tunnelbroker");
if (comm::network::tools::isSandbox()) {
comm::network::config::ConfigManager::getInstance().load(
comm::network::DEV_CONFIG_FILE_PATH);

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 19, 1:24 AM (21 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2536141
Default Alt Text
D4588.id14767.diff (1 KB)

Event Timeline