diff options
| author | Dan Engelbrecht <[email protected]> | 2022-09-12 23:38:47 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-09-12 14:38:47 -0700 |
| commit | ef89c146f6ef3f0091ce2f4736cbda2dd7cf84a0 (patch) | |
| tree | 5cc20561b428de8c0d271286d63cd6d69d6abc92 /zenserver/zenserver.cpp | |
| parent | create release in Sentry and set version string in executable (#162) (diff) | |
| download | zen-ef89c146f6ef3f0091ce2f4736cbda2dd7cf84a0.tar.xz zen-ef89c146f6ef3f0091ce2f4736cbda2dd7cf84a0.zip | |
enable json log file (#164)
* Include source location on ZEN_ERROR and ZEN_CRITICAL
* Use proper logging for sentry init status
* format file logger as json if .json extension is given
* changelog
Diffstat (limited to 'zenserver/zenserver.cpp')
| -rw-r--r-- | zenserver/zenserver.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/zenserver/zenserver.cpp b/zenserver/zenserver.cpp index 759c08476..1c94d80b7 100644 --- a/zenserver/zenserver.cpp +++ b/zenserver/zenserver.cpp @@ -948,7 +948,7 @@ ZenEntryPoint::Run() { #if ZEN_USE_SENTRY std::string SentryDatabasePath = PathToUtf8(m_ServerOptions.DataDir / ".sentry-native"); - + int SentryErrorCode = 0; if (m_ServerOptions.NoSentry == false) { sentry_options_t* SentryOptions = sentry_options_new(); @@ -959,14 +959,7 @@ ZenEntryPoint::Run() sentry_options_set_release(SentryOptions, ZEN_CFG_VERSION); // sentry_options_set_debug(SentryOptions, 1); - if (int ErrorCode = sentry_init(SentryOptions); ErrorCode == 0) - { - printf("sentry initialized"); - } - else - { - printf("sentry_init returned failure! (error code: %d)", ErrorCode); - } + SentryErrorCode = sentry_init(SentryOptions); } auto _ = zen::MakeGuard([] { sentry_close(); }); @@ -1002,6 +995,17 @@ ZenEntryPoint::Run() InitializeLogging(ServerOptions); +#if ZEN_USE_SENTRY + if (SentryErrorCode == 0) + { + ZEN_INFO("sentry initialized"); + } + else + { + ZEN_WARN("sentry_init returned failure! (error code: {})", SentryErrorCode); + } +#endif + MaximizeOpenFileCount(); ZEN_INFO(ZEN_APP_NAME " - using lock file at '{}'", LockFilePath); |