refactor: Improve logging and args for Windows daemon install/uninstall
This commit is contained in:
parent
8debc1ea7f
commit
95603c82ec
1 changed files with 6 additions and 6 deletions
|
|
@ -118,17 +118,17 @@ int DaemonApp::run(int argc, char **argv)
|
||||||
for (int i = 1; i < argc; ++i) {
|
for (int i = 1; i < argc; ++i) {
|
||||||
string arg(argv[i]);
|
string arg(argv[i]);
|
||||||
|
|
||||||
if (arg == "/f" || arg == "-f") {
|
if (arg == "-f") {
|
||||||
foreground = true;
|
foreground = true;
|
||||||
}
|
}
|
||||||
#if SYSAPI_WIN32
|
#if SYSAPI_WIN32
|
||||||
else if (arg == "/install") {
|
else if (arg == "--install" || arg == "/install") {
|
||||||
LOG((CLOG_PRINT "installing windows daemon"));
|
LOG((CLOG_NOTE "installing windows daemon"));
|
||||||
uninstall = true;
|
uninstall = true;
|
||||||
ARCH->installDaemon();
|
ARCH->installDaemon();
|
||||||
return kExitSuccess;
|
return kExitSuccess;
|
||||||
} else if (arg == "/uninstall") {
|
} else if (arg == "--uninstall" || arg == "/uninstall") {
|
||||||
LOG((CLOG_PRINT "uninstalling windows daemon"));
|
LOG((CLOG_NOTE "uninstalling windows daemon"));
|
||||||
ARCH->uninstallDaemon();
|
ARCH->uninstallDaemon();
|
||||||
return kExitSuccess;
|
return kExitSuccess;
|
||||||
}
|
}
|
||||||
|
|
@ -150,7 +150,7 @@ int DaemonApp::run(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (foreground) {
|
if (foreground) {
|
||||||
LOG((CLOG_PRINT "starting daemon in foreground"));
|
LOG((CLOG_NOTE "starting daemon in foreground"));
|
||||||
|
|
||||||
// run process in foreground instead of daemonizing.
|
// run process in foreground instead of daemonizing.
|
||||||
// useful for debugging.
|
// useful for debugging.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue