Logs inside the WebUI (#634)

This commit is contained in:
Elia Zammuto 2023-01-01 02:12:36 +01:00 committed by GitHub
commit a5213c6225
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 125 additions and 13 deletions

View file

@ -101,6 +101,7 @@ int entry(const char *name, int argc, char *argv[]) {
}
} // namespace version
void log_flush() {
sink->flush();
}
@ -219,6 +220,7 @@ int main(int argc, char *argv[]) {
boost::shared_ptr<std::ostream> stream { &std::cout, NoDelete {} };
sink->locked_backend()->add_stream(stream);
sink->locked_backend()->add_stream(boost::make_shared<std::ofstream>(config::sunshine.log_file));
sink->set_filter(severity >= config::sunshine.min_log_level);
sink->set_formatter([message = "Message"s, severity = "Severity"s](const bl::record_view &view, bl::formatting_ostream &os) {