1// [Blend2D]
2// 2D Vector Graphics Powered by a JIT Compiler.
3//
4// [License]
5// Zlib - See LICENSE.md file in the package.
6
7#include "./blapi-build_p.h"
8#include "./bltrace_p.h"
9
10// ============================================================================
11// [BLOpenType::BLDebugTrace]
12// ============================================================================
13
14void BLDebugTrace::log(uint32_t severity, uint32_t indentation, const char* fmt, ...) noexcept {
15 const char* prefix = "";
16 if (indentation < 0xFFFFFFFFu) {
17 switch (severity) {
18 case 1: prefix = "[WARN] "; break;
19 case 2: prefix = "[FAIL] "; break;
20 }
21 blRuntimeMessageFmt("%*s%s", indentation * 2, "", prefix);
22 }
23
24 va_list ap;
25 va_start(ap, fmt);
26 blRuntimeMessageVFmt(fmt, ap);
27 va_end(ap);
28}
29