mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
Reduce logging overhead and reuse WMO culling futures
This commit is contained in:
parent
4ea4cb761c
commit
c914295d20
4 changed files with 22 additions and 7 deletions
|
|
@ -35,7 +35,7 @@ void Logger::ensureFile() {
|
|||
}
|
||||
|
||||
void Logger::log(LogLevel level, const std::string& message) {
|
||||
if (level < minLevel) {
|
||||
if (!shouldLog(level)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -93,7 +93,11 @@ void Logger::log(LogLevel level, const std::string& message) {
|
|||
}
|
||||
|
||||
void Logger::setLogLevel(LogLevel level) {
|
||||
minLevel = level;
|
||||
minLevel_.store(static_cast<int>(level), std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
bool Logger::shouldLog(LogLevel level) const {
|
||||
return static_cast<int>(level) >= minLevel_.load(std::memory_order_relaxed);
|
||||
}
|
||||
|
||||
} // namespace core
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue