Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3301270
D4588.id14767.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4588.id14767.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D4588: [services] Tunnelbroker - Move init logging to the global tools
Attached
Detach File
Event Timeline
Log In to Comment