Write Sunshine log output to disk and hide the window

This commit is contained in:
Cameron Gutman 2021-08-03 19:25:40 -05:00
commit b4255e22aa
2 changed files with 37 additions and 6 deletions

View file

@ -185,6 +185,10 @@ int main(int argc, char *argv[]) {
os << _date << log_type << view.attribute_values()[message].extract<std::string>();
});
// Flush after each log record to ensure log file contents on disk isn't stale.
// This is particularly important when running from a Windows service.
sink->locked_backend()->auto_flush(true);
bl::core::get()->add_sink(sink);
auto fg = util::fail_guard(log_flush);