2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
18#ifndef GIMBAL_LOGGER_H
19#define GIMBAL_LOGGER_H
22#include "../meta/instances/gimbal_object.h"
23#include "../containers/gimbal_linked_list.h"
26
27
28
30#define GBL_LOGGER(self) (GBL_CAST
(GblLogger, self))
31#define GBL_LOGGER_CLASS(klass) (GBL_CLASS_CAST
(GblLogger, klass))
32#define GBL_LOGGER_GET_CLASS(self) (GBL_CLASSOF
(GblLogger, self))
36
37
38
39#define GBL_LOG_WRITE(flags, domain, ...) GblLogger_write(__FILE__, __func__, __LINE__,
40 domain, flags, __VA_ARGS__)
46#define GBL_LOG_PUSH() GblLogger_push()
47#define GBL_LOG_POP(n) GblLogger_pop(n)
62#define GBL_SELF_TYPE GblLogger
69typedef GblBool (*GblLoggerIterFn)(GblLogger* pLogger,
void* pClosure);
83
84
85
86
87
88
89
90
91
92
97 const char* pFunction,
115
116
117
118
119
120
121
122
123
124
156GBL_EXPORT GBL_RESULT GblLogger_write (
const char* pFile,
157 const char* pFunction,
164GBL_EXPORT GBL_RESULT GblLogger_writeVa (
const char* pFile,
165 const char* pFunction,
183 const GblThd* pThread,
209#define GBL_LOG_MAKE_PUSH_(domain, level_macro, ...)
211 level_macro(domain, __VA_ARGS__);
216#define GBL_LOG_MAKE_SCOPE_(domain, level_macro, ...)
218 level_macro(domain, __VA_ARGS__);
#define GBL_FORWARD_DECLARE_STRUCT(S)
#define GBL_TYPEID(instanceStruct)
#define GBL_INSTANCE_DERIVE(derivedInstance, baseInstance)
#define GBL_PRIVATE_BEGIN
#define GBL_CLASS_DERIVE(...)
#define GBL_DECLARE_FLAGS(F)
#define GBL_PRIVATE_END
Private data structure.
#define GBL_FLAGS_TYPE
GblType UUID for flags.
#define GBL_LOG_ERROR(domain,...)
Writes to log with GBL_LOG_ERROR.
#define GBL_LOG_WRITE(flags, domain,...)
Generalized log write operation.
#define GBL_LOG_INFO(domain,...)
Writes to log with GBL_LOG_INFO.
#define GBL_LOG_PUSH()
Pushes level to log stack.
#define GBL_LOG_DEBUG(domain,...)
Writes to log with GBL_LOG_DEBUG.
#define GBL_LOG_MAKE_SCOPE_(domain, level_macro,...)
#define GBL_LOG_VERBOSE(domain,...)
Writes to log with GBL_LOG_VERBOSE.
#define GBL_LOG_WARN(domain,...)
Writes to log with GBL_LOG_WARN.
#define GBL_LOG_POP(n)
Pops N levels from log stack.
@ GBL_LOG_INFO
Denotes an "info" message, which is typically used for noteworthy events.
@ GBL_LOG_VERBOSE
Denotes a "verbose" level message, which is regular-level.
@ GBL_LOG_REENTRANT
Denotes a GblLogger's virtual methods are reentrant.
@ GBL_LOG_WARN
Denotes a "warning" message, which means a potential issue has arisen.
@ GBL_LOG_ERROR
Denotes an "error" message, which means something has failed.
@ GBL_LOG_DEBUG
Denotes a "debug" level message, which is typically disabled.
@ GBL_LOG_USER
Denotess the first flag which can be used for arbitrary userdata.
#define GBL_LOG_MAKE_PUSH_(domain, level_macro,...)
#define GBL_SCOPE(begin, end)
#define GBL_PROPERTIES(object,...)
Declares a list of properties for the given object/instance structure.
uint32_t GblFlags
Standard-sized flags type, 32-bits across platforms.
uint8_t GblBool
Basic boolean type, standardized to sizeof(char)
uint16_t GblRefCount
Type able to hold a reference counter across the codebase.
Object used for implementing a custom logger.
GblLinkedListNode listNode
Internal generic list node.
GblLogger * pNext
Internal pointer to next logger in list.
GblFlags flagsFilter
Combination of GBL_LOG_FLAGS to filter messages for.
GblBool reentrant
Whether the logger is already handling a messaage.