[Libreoffice-commits] online.git: loolwsd/LOOLForKit.cpp loolwsd/LOOLKit.cpp
Henry Castro
hcastro at collabora.com
Thu Oct 6 19:01:08 UTC 2016
loolwsd/LOOLForKit.cpp | 4 +++-
loolwsd/LOOLKit.cpp | 4 +++-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit b60f596a64313ad980fed9417778079a10fc294a
Author: Henry Castro <hcastro at collabora.com>
Date: Thu Oct 6 15:02:13 2016 -0400
loolwsd: avoid getenv() nullptr
what(): basic_string::_S_construct null not valid
diff --git a/loolwsd/LOOLForKit.cpp b/loolwsd/LOOLForKit.cpp
index f6f428f..1fca1aa 100644
--- a/loolwsd/LOOLForKit.cpp
+++ b/loolwsd/LOOLForKit.cpp
@@ -201,13 +201,15 @@ int main(int argc, char** argv)
// Initialization
const bool logToFile = getenv("LOOL_LOGFILE");
const auto logFilename = getenv("LOOL_LOGFILENAME");
+ const auto logLevel = getenv("LOOL_LOGLEVEL");
+ const auto logColor = getenv("LOOL_LOGCOLOR");
std::map<std::string, std::string> logProperties;
if (logToFile && logFilename)
{
logProperties["path"] = std::string(logFilename);
}
- Log::initialize("frk", getenv("LOOL_LOGLEVEL"), getenv("LOOL_LOGCOLOR"), logToFile, logProperties);
+ Log::initialize("frk", logLevel ? logLevel : "", logColor ? logColor : "", logToFile, logProperties);
Util::setTerminationSignals();
Util::setFatalSignals();
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index d381315..632f407 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -1359,13 +1359,15 @@ void lokit_main(const std::string& childRoot,
// Reinitialize logging when forked.
const bool logToFile = getenv("LOOL_LOGFILE");
const auto logFilename = getenv("LOOL_LOGFILENAME");
+ const auto logLevel = getenv("LOOL_LOGLEVEL");
+ const auto logColor = getenv("LOOL_LOGCOLOR");
std::map<std::string, std::string> logProperties;
if (logToFile && logFilename)
{
logProperties["path"] = std::string(logFilename);
}
- Log::initialize("kit", getenv("LOOL_LOGLEVEL"), getenv("LOOL_LOGCOLOR"), logToFile, logProperties);
+ Log::initialize("kit", logLevel ? logLevel : "", logColor ? logColor : "", logToFile, logProperties);
Util::rng::reseed();
assert(!childRoot.empty());
More information about the Libreoffice-commits
mailing list