aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zencore/include/zencore/logging.h4
-rw-r--r--src/zenserver/zenserver.cpp8
2 files changed, 7 insertions, 5 deletions
diff --git a/src/zencore/include/zencore/logging.h b/src/zencore/include/zencore/logging.h
index c40af1310..6a8fd7254 100644
--- a/src/zencore/include/zencore/logging.h
+++ b/src/zencore/include/zencore/logging.h
@@ -31,6 +31,10 @@ extern spdlog::logger* TheDefaultLogger;
inline spdlog::logger&
Log()
{
+ if (TheDefaultLogger == nullptr)
+ {
+ return zen::logging::ConsoleLog();
+ }
return *TheDefaultLogger;
}
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index 826924952..f9221ed0f 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -1095,7 +1095,7 @@ ZenEntryPoint::Run()
{
if (ServerOptions.OwnerPid)
{
- ConsoleLog().info(
+ ZEN_INFO(
"Looks like there is already a process listening to this port {} (pid: {}), attaching owner pid {} to running instance",
ServerOptions.BasePort,
Entry->Pid,
@@ -1107,9 +1107,7 @@ ZenEntryPoint::Run()
}
else
{
- ConsoleLog().warn("Exiting since there is already a process listening to port {} (pid: {})",
- ServerOptions.BasePort,
- Entry->Pid);
+ ZEN_WARN("Exiting since there is already a process listening to port {} (pid: {})", ServerOptions.BasePort, Entry->Pid);
std::exit(1);
}
}
@@ -1131,7 +1129,7 @@ ZenEntryPoint::Run()
if (Ec)
{
- ConsoleLog().warn("ERROR: Unable to grab lock at '{}' (error: '{}')", LockFilePath, Ec.message());
+ ZEN_WARN("ERROR: Unable to grab lock at '{}' (error: '{}')", LockFilePath, Ec.message());
std::exit(99);
}