MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / patternAndSink

Method patternAndSink

modules/core/core/src/core/log/log_worker.cpp:286–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286void LogWorker::patternAndSink(const LogElement& e) SKR_NOEXCEPT
287{
288 if (e.valid)
289 {
290 SkrZoneScopedNC("LogSingle", tracy::Color::Orchid1);
291 const auto& what = e.need_format ?
292 formatter_.format(e.format, e.args) :
293 e.format;
294 skr::log::LogManager::Get()->PatternAndSink(e.event, what.view());
295
296 if (auto should_backtrace = LogManager::Get()->ShouldBacktrace(e.event))
297 {
298 SkrZoneScopedNC("Backtrace", tracy::Color::Orchid2);
299 const auto tid = (SThreadID)e.event.get_thread_id();
300 if (auto token = queue_->query_token(tid))
301 {
302 for (int64_t i = token->backtraces_.get_size() - 1; i >= 0; i--)
303 {
304 const auto bt_e = token->backtraces_.get(i);
305 if (bt_e.valid)
306 {
307 const auto& bt_what = bt_e.need_format ?
308 formatter_.format(bt_e.format, bt_e.args) :
309 bt_e.format;
310 skr::log::LogManager::Get()->PatternAndSink(bt_e.event, bt_what.view());
311 }
312 }
313 token->backtraces_.zero();
314 }
315 }
316
317 queue_->finish(e);
318 }
319}
320
321} } // namespace skr::log
322

Callers

nothing calls this directly

Calls 10

PatternAndSinkMethod · 0.80
ShouldBacktraceMethod · 0.80
query_tokenMethod · 0.80
GetFunction · 0.50
formatMethod · 0.45
viewMethod · 0.45
get_sizeMethod · 0.45
getMethod · 0.45
zeroMethod · 0.45
finishMethod · 0.45

Tested by

no test coverage detected