VLCB SDK
An opinionated SDK for VLCB protocol
Loading...
Searching...
No Matches
log.c
Go to the documentation of this file.
1#include "vlcb/platform/log.h"
2
3#ifndef VLCB_NOLOGGING
4
5#include <stddef.h>
6
8
9void LogMessage(const VlcbLogMessage message) {
10 if (message.message != NULL && logHandler != NULL) {
11 logHandler(message);
12 }
13}
14
15void VlcbLogInfo(vlcb_error message) {
16 LogMessage((VlcbLogMessage){.type = VLCB_LOG_INFO, .message = message});
17}
18
19void VlcbLogError(vlcb_error message) {
20 LogMessage((VlcbLogMessage){.type = VLCB_LOG_ERROR, .message = message});
21}
22
23#ifdef DEBUG
24void VlcbLogDebug(vlcb_error message) {
25 LogMessage((VlcbLogMessage){.type = VLCB_LOG_DEBUG, .message = message});
26}
27#endif /* ifdef DEBUG */
28
32
33#endif // !VLCB_NOLOGGING
const char *const vlcb_error
Definition error.h:3
void VlcbLogInfo(vlcb_error message)
Definition log.c:15
void LogMessage(const VlcbLogMessage message)
Definition log.c:9
static VlcbLogMessageHandler * logHandler
Definition log.c:7
void VlcbLogError(vlcb_error message)
Definition log.c:19
void vlcb_log_RegisterMessageHandler(VlcbLogMessageHandler handler)
Definition log.c:29
@ VLCB_LOG_ERROR
Definition log.h:9
@ VLCB_LOG_INFO
Definition log.h:8
void VlcbLogMessageHandler(VlcbLogMessage msg)
Definition log.h:26
vlcb_error message
Definition log.h:17