fix: Move version print line after file outputter is created
This commit is contained in:
parent
3ef5793beb
commit
b5d12b8aa5
1 changed files with 7 additions and 2 deletions
|
|
@ -44,8 +44,6 @@ int main(int argc, char **argv)
|
||||||
Log log;
|
Log log;
|
||||||
EventQueue events;
|
EventQueue events;
|
||||||
|
|
||||||
LOG((CLOG_PRINT "%s daemon (v%s)", kAppName, kVersion));
|
|
||||||
|
|
||||||
auto &daemon = DaemonApp::instance();
|
auto &daemon = DaemonApp::instance();
|
||||||
DaemonApp::InitResult initResult;
|
DaemonApp::InitResult initResult;
|
||||||
try {
|
try {
|
||||||
|
|
@ -58,6 +56,13 @@ int main(int argc, char **argv)
|
||||||
return kExitFailed;
|
return kExitFailed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Important: Log the app name and version number to the log file after the daemon app init
|
||||||
|
// because the file log outputter is created there. Logging before would only log to stdout
|
||||||
|
// which is not useful for troubleshooting Windows services.
|
||||||
|
// It's important to write the version number to the log file so we can be certain the old daemon
|
||||||
|
// was uninstalled, since sometimes Windows services can get stuck and fail to be removed.
|
||||||
|
LOG_PRINT("%s Daemon (v%s)", kAppName, kVersion);
|
||||||
|
|
||||||
switch (initResult) {
|
switch (initResult) {
|
||||||
using enum DaemonApp::InitResult;
|
using enum DaemonApp::InitResult;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue