mirror of
https://github.com/azahar-emu/azahar.git
synced 2025-05-12 05:26:39 +03:00
Logging: check for filter before sending to the queue, to skip all heavy formatting on the other thread.
This commit is contained in:
parent
53ba65db43
commit
0aa44e238d
7 changed files with 21 additions and 9 deletions
|
@ -135,9 +135,18 @@ Entry CreateEntry(Class log_class, Level log_level,
|
|||
return std::move(entry);
|
||||
}
|
||||
|
||||
static Filter* filter;
|
||||
|
||||
void SetFilter(Filter* new_filter) {
|
||||
filter = new_filter;
|
||||
}
|
||||
|
||||
void LogMessage(Class log_class, Level log_level,
|
||||
const char* filename, unsigned int line_nr, const char* function,
|
||||
const char* format, ...) {
|
||||
if (!filter->CheckMessage(log_class, log_level))
|
||||
return;
|
||||
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
Entry entry = CreateEntry(log_class, log_level,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue