-
Notifications
You must be signed in to change notification settings - Fork 6
/
log.c
54 lines (47 loc) · 1.36 KB
/
log.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// --------------------------------------------------------------------------
//
// C Kong
// Copyright (C) 2018 Jeff Panici
// All rights reserved.
//
// This software source file is licensed according to the
// MIT License. Refer to the LICENSE file distributed along
// with this source file to learn more.
//
// --------------------------------------------------------------------------
#include <stdarg.h>
#include <SDL_log.h>
#include "log.h"
void log_init(void) {
SDL_LogSetAllPriority(SDL_LOG_PRIORITY_INFO);
}
void log_warn(log_category_t category, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
SDL_LogWarn(category, fmt, args);
va_end(args);
}
void log_debug(log_category_t category, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
SDL_LogDebug(category, fmt, args);
va_end(args);
}
void log_error(log_category_t category, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
SDL_LogError(category, fmt, args);
va_end(args);
}
void log_message(log_category_t category, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
SDL_LogMessageV(category, SDL_LOG_PRIORITY_INFO, fmt, args);
va_end(args);
}
void log_critical(log_category_t category, const char* fmt, ...) {
va_list args;
va_start(args, fmt);
SDL_LogCritical(category, fmt, args);
va_end(args);
}