|
|
@ -208,6 +208,10 @@ public:
|
|
|
|
instance->StartBackendThread();
|
|
|
|
instance->StartBackendThread();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void Stop() {
|
|
|
|
|
|
|
|
instance->StopBackendThread();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Impl(const Impl&) = delete;
|
|
|
|
Impl(const Impl&) = delete;
|
|
|
|
Impl& operator=(const Impl&) = delete;
|
|
|
|
Impl& operator=(const Impl&) = delete;
|
|
|
|
|
|
|
|
|
|
|
@ -259,6 +263,15 @@ private:
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void StopBackendThread() {
|
|
|
|
|
|
|
|
backend_thread.request_stop();
|
|
|
|
|
|
|
|
if (backend_thread.joinable()) {
|
|
|
|
|
|
|
|
backend_thread.join();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ForEachBackend([](Backend& backend) { backend.Flush(); });
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr,
|
|
|
|
Entry CreateEntry(Class log_class, Level log_level, const char* filename, unsigned int line_nr,
|
|
|
|
const char* function, std::string&& message) const {
|
|
|
|
const char* function, std::string&& message) const {
|
|
|
|
using std::chrono::duration_cast;
|
|
|
|
using std::chrono::duration_cast;
|
|
|
@ -313,6 +326,10 @@ void Start() {
|
|
|
|
Impl::Start();
|
|
|
|
Impl::Start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Stop() {
|
|
|
|
|
|
|
|
Impl::Stop();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DisableLoggingInTests() {
|
|
|
|
void DisableLoggingInTests() {
|
|
|
|
initialization_in_progress_suppress_logging = true;
|
|
|
|
initialization_in_progress_suppress_logging = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|