10 .categoryMask = 0xFFFFFFFF,
14 .maxFileSize = 10 * 1024 * 1024,
21 [1] =
"SBGL_ERROR_NULL_CONTEXT",
22 [2] =
"SBGL_ERROR_INVALID_ARGUMENT",
23 [3] =
"SBGL_ERROR_INITIALIZATION_FAILED",
24 [4] =
"SBGL_ERROR_WINDOW_CREATION_FAILED",
25 [5] =
"SBGL_ERROR_GRAPHICS_FAILED",
26 [6] =
"SBGL_ERROR_OUT_OF_MEMORY",
27 [7] =
"SBGL_ERROR_DEVICE_BUSY",
28 [8] =
"SBGL_ERROR_INVALID_HANDLE",
29 [9] =
"SBGL_ERROR_SWAPCHAIN_FAILED",
30 [10] =
"SBGL_ERROR_SHADER_FAILED",
31 [11] =
"SBGL_ERROR_PIPELINE_FAILED",
32 [12] =
"SBGL_ERROR_PLATFORM_FAILED",
35#define VK_RESULT_COUNT 23
38 -1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11,
39 -13, -14, -15, -16, -17, -18
49 "VK_ERROR_OUT_OF_HOST_MEMORY",
50 "VK_ERROR_OUT_OF_DEVICE_MEMORY",
51 "VK_ERROR_INITIALIZATION_FAILED",
52 "VK_ERROR_DEVICE_LOST",
53 "VK_ERROR_MEMORY_MAP_FAILED",
54 "VK_ERROR_LAYER_NOT_PRESENT",
55 "VK_ERROR_EXTENSION_NOT_PRESENT",
56 "VK_ERROR_FEATURE_NOT_PRESENT",
57 "VK_ERROR_INCOMPATIBLE_DRIVER",
58 "VK_ERROR_TOO_MANY_OBJECTS",
59 "VK_ERROR_FORMAT_NOT_FOUND",
60 "VK_ERROR_SURFACE_LOST_KHR",
61 "VK_ERROR_NATIVE_WINDOW_IN_USE_KHR",
62 "VK_ERROR_OUT_OF_DATE_KHR",
63 "VK_ERROR_INCOMPATIBLE_DISPLAY_KHR",
64 "VK_ERROR_VALIDATION_FAILED_EXT",
65 "VK_ERROR_INVALID_SHADER_NV",
94 rename(old_path, new_path);
121 const char* function,
127 time_t now = time(NULL);
128 struct tm* tm_info = localtime(&now);
130 strftime(time_buf,
sizeof(time_buf),
"%Y-%m-%d %H:%M:%S", tm_info);
133 int len = snprintf(out,
sizeof(out),
"[%s] [%s] [%s] %s:%d (%s): %s\n",
157 fwrite(out, 1, len,
s_file);
164 fwrite(out, 1, len, dst);
195 return "SBGL_UNKNOWN_ERROR";
sbgl_LogCategory
Logging categories for component filtering.
sbgl_LogLevel
Logging severity levels.
static const char *const VK_RESULT_STRINGS[]
static const int32_t VK_RESULT_CODES[]
static const char * level_strings[]
void sbgl_LogSetOutput(const char *path)
static void open_log_file(void)
static sbgl_LogConfig s_config
static void rotate_logs(void)
static const char *const SBGL_RESULT_STRINGS[]
void sbgl_internal_log_impl(sbgl_LogLevel level, sbgl_LogCategory category, const char *file, int line, const char *function, const char *message)
void sbgl_LogSetFileRotation(uint32_t maxFiles, size_t maxFileSize)
static const char * category_strings[]
const char * sbgl_ResultToString(int result)
void sbgl_LogSetLevel(sbgl_LogLevel minLevel)
const char * sbgl_VkResultToString(int32_t vkResult)