SBgl
0.1.0
A graphics framework in C99
Loading...
Searching...
No Matches
sbgl_internal_log.h
Go to the documentation of this file.
1
#ifndef SBGL_INTERNAL_LOG
2
#define SBGL_INTERNAL_LOG
3
4
#include <stdbool.h>
5
#include <stdint.h>
6
#include <stddef.h>
7
11
typedef
enum
{
12
SBGL_LOG_DEBUG
= 0,
13
SBGL_LOG_INFO
= 1,
14
SBGL_LOG_WARN
= 2,
15
SBGL_LOG_ERROR
= 3,
16
SBGL_LOG_CRITICAL
= 4,
17
}
sbgl_LogLevel
;
18
22
typedef
enum
{
23
SBGL_LOG_CAT_CORE
= 0,
24
SBGL_LOG_CAT_PLATFORM
= 1,
25
SBGL_LOG_CAT_GFX
= 2,
26
SBGL_LOG_CAT_INPUT
= 3,
27
SBGL_LOG_CAT_VOXEL
= 4,
28
SBGL_LOG_CAT_COUNT
= 5,
29
}
sbgl_LogCategory
;
30
34
typedef
struct
{
35
sbgl_LogLevel
minLevel
;
36
uint32_t
categoryMask
;
37
bool
fileEnabled
;
38
const
char
*
filePath
;
39
uint32_t
maxFiles
;
40
size_t
maxFileSize
;
41
}
sbgl_LogConfig
;
42
43
void
sbgl_internal_log_impl
(
44
sbgl_LogLevel
level,
45
sbgl_LogCategory
category,
46
const
char
* file,
47
int
line,
48
const
char
* function,
49
const
char
* message
50
);
51
52
#define sbgl_log_impl(level, category, msg) \
53
sbgl_internal_log_impl(level, category, __FILE__, __LINE__, __func__, msg)
54
55
void
sbgl_LogSetLevel
(
sbgl_LogLevel
minLevel);
56
void
sbgl_LogSetOutput
(
const
char
* path);
57
void
sbgl_LogSetFileRotation
(uint32_t maxFiles,
size_t
maxSize);
58
const
char
*
sbgl_ResultToString
(
int
result);
59
const
char
*
sbgl_VkResultToString
(int32_t vkResult);
60
61
#endif
// !SBGL_INTERNAL_LOG
sbgl_LogSetOutput
void sbgl_LogSetOutput(const char *path)
Definition
sbgl_log.c:171
sbgl_LogCategory
sbgl_LogCategory
Logging categories for component filtering.
Definition
sbgl_internal_log.h:22
SBGL_LOG_CAT_PLATFORM
@ SBGL_LOG_CAT_PLATFORM
Definition
sbgl_internal_log.h:24
SBGL_LOG_CAT_INPUT
@ SBGL_LOG_CAT_INPUT
Definition
sbgl_internal_log.h:26
SBGL_LOG_CAT_COUNT
@ SBGL_LOG_CAT_COUNT
Definition
sbgl_internal_log.h:28
SBGL_LOG_CAT_GFX
@ SBGL_LOG_CAT_GFX
Definition
sbgl_internal_log.h:25
SBGL_LOG_CAT_CORE
@ SBGL_LOG_CAT_CORE
Definition
sbgl_internal_log.h:23
SBGL_LOG_CAT_VOXEL
@ SBGL_LOG_CAT_VOXEL
Definition
sbgl_internal_log.h:27
sbgl_LogLevel
sbgl_LogLevel
Logging severity levels.
Definition
sbgl_internal_log.h:11
SBGL_LOG_CRITICAL
@ SBGL_LOG_CRITICAL
Definition
sbgl_internal_log.h:16
SBGL_LOG_WARN
@ SBGL_LOG_WARN
Definition
sbgl_internal_log.h:14
SBGL_LOG_ERROR
@ SBGL_LOG_ERROR
Definition
sbgl_internal_log.h:15
SBGL_LOG_INFO
@ SBGL_LOG_INFO
Definition
sbgl_internal_log.h:13
SBGL_LOG_DEBUG
@ SBGL_LOG_DEBUG
Definition
sbgl_internal_log.h:12
sbgl_LogSetFileRotation
void sbgl_LogSetFileRotation(uint32_t maxFiles, size_t maxSize)
Definition
sbgl_log.c:186
sbgl_internal_log_impl
void sbgl_internal_log_impl(sbgl_LogLevel level, sbgl_LogCategory category, const char *file, int line, const char *function, const char *message)
Definition
sbgl_log.c:116
sbgl_ResultToString
const char * sbgl_ResultToString(int result)
Definition
sbgl_log.c:191
sbgl_LogSetLevel
void sbgl_LogSetLevel(sbgl_LogLevel minLevel)
Definition
sbgl_log.c:167
sbgl_VkResultToString
const char * sbgl_VkResultToString(int32_t vkResult)
Definition
sbgl_log.c:198
sbgl_LogConfig
Logging configuration.
Definition
sbgl_internal_log.h:34
sbgl_LogConfig::filePath
const char * filePath
Definition
sbgl_internal_log.h:38
sbgl_LogConfig::maxFileSize
size_t maxFileSize
Definition
sbgl_internal_log.h:40
sbgl_LogConfig::fileEnabled
bool fileEnabled
Definition
sbgl_internal_log.h:37
sbgl_LogConfig::maxFiles
uint32_t maxFiles
Definition
sbgl_internal_log.h:39
sbgl_LogConfig::minLevel
sbgl_LogLevel minLevel
Definition
sbgl_internal_log.h:35
sbgl_LogConfig::categoryMask
uint32_t categoryMask
Definition
sbgl_internal_log.h:36
src
core
sbgl_internal_log.h
Generated by
1.12.0