wsd: flush logs before existing

This is important for when we abort with some explanation.
Often said explanation doesn't show up anywhere to be useful.

Also, issue fatal logs for abnormal exist and use SFL to log errno.

Reviewed-on: https://gerrit.libreoffice.org/57540
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit ad7964393e)

Change-Id: Ic67064ef40ef6e93d26e5847ecd32bdd49c3cc8b
This commit is contained in:
Ashod Nakashian
2018-07-16 21:42:17 -04:00
parent 053161b3f5
commit 00a44d6e81
7 changed files with 62 additions and 25 deletions

View File

@ -20,6 +20,7 @@
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
@ -182,6 +183,17 @@ namespace Log
{
return Poco::Logger::get(Source.inited ? Source.name : std::string());
}
void shutdown()
{
logger().shutdown();
// Flush
std::flush(std::cout);
fflush(stdout);
std::flush(std::cerr);
fflush(stderr);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */