VSF Documented
SDL_log.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_SDL2_LOG_H__
19#define __VSF_SDL2_LOG_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "../../vsf_sdl2_cfg.h"
24
25#if VSF_USE_SDL2 == ENABLED
26
27// for vsf_trace
28#include "service/vsf_service.h"
29#include "SDL_stdinc.h"
30
31#include "begin_code.h"
32
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37/*============================ MACROS ========================================*/
38/*============================ MACROFIED FUNCTIONS ===========================*/
39
40#define SDL_LogMessage(__category, __prio, __fmt, ...) \
41 __SDL_LogMessage(__prio, (__category), (__fmt), ##__VA_ARGS__)
42#define SDL_Log(...) __SDL_LogMessage(SDL_LOG_PRIORITY_INFO, 0, __VA_ARGS__)
43#define SDL_LogInfo(...) __SDL_LogMessage(SDL_LOG_PRIORITY_INFO, __VA_ARGS__)
44#define SDL_LogError(...) __SDL_LogMessage(SDL_LOG_PRIORITY_ERROR, __VA_ARGS__)
45#define SDL_LogCritical(...) __SDL_LogMessage(SDL_LOG_PRIORITY_ERROR, __VA_ARGS__)
46#define SDL_LogDebug(...) __SDL_LogMessage(SDL_LOG_PRIORITY_DEBUG, __VA_ARGS__)
47#define SDL_LogWarn(...) __SDL_LogMessage(SDL_LOG_PRIORITY_WARN, __VA_ARGS__)
48#define SDL_LogVerbose(...) __SDL_LogMessage(SDL_LOG_PRIORITY_INFO, __VA_ARGS__)
49
50/*============================ TYPES =========================================*/
51
52typedef enum SDL_LogCategory {
63
64typedef enum SDL_LogPriority {
72
73/*============================ GLOBAL VARIABLES ==============================*/
74/*============================ LOCAL VARIABLES ===============================*/
75/*============================ PROTOTYPES ====================================*/
76
77extern void __SDL_LogMessage(SDL_LogPriority priority, int category, const char *fmt, ...);
78
79#ifdef __cplusplus
80}
81#endif
82#include "close_code.h"
83
84#endif // VSF_USE_SDL2
85#endif // __VSF_SDL2_LOG_H__
86/* EOF */
SDL_LogPriority
Definition SDL_log.h:64
@ SDL_LOG_PRIORITY_INFO
Definition SDL_log.h:67
@ SDL_LOG_PRIORITY_CRITICAL
Definition SDL_log.h:70
@ SDL_LOG_PRIORITY_VERBOSE
Definition SDL_log.h:65
@ SDL_LOG_PRIORITY_DEBUG
Definition SDL_log.h:66
@ SDL_LOG_PRIORITY_ERROR
Definition SDL_log.h:69
@ SDL_LOG_PRIORITY_WARN
Definition SDL_log.h:68
void __SDL_LogMessage(SDL_LogPriority priority, int category, const char *fmt,...)
Definition vsf_sdl2.c:152
SDL_LogCategory
Definition SDL_log.h:52
@ SDL_LOG_CATEGORY_ERROR
Definition SDL_log.h:54
@ SDL_LOG_CATEGORY_RENDER
Definition SDL_log.h:59
@ SDL_LOG_CATEGORY_INPUT
Definition SDL_log.h:60
@ SDL_LOG_CATEGORY_TEST
Definition SDL_log.h:61
@ SDL_LOG_CATEGORY_SYSTEM
Definition SDL_log.h:56
@ SDL_LOG_CATEGORY_APPLICATION
Definition SDL_log.h:53
@ SDL_LOG_CATEGORY_AUDIO
Definition SDL_log.h:57
@ SDL_LOG_CATEGORY_ASSERT
Definition SDL_log.h:55
@ SDL_LOG_CATEGORY_VIDEO
Definition SDL_log.h:58
u8 category
Definition ieee80211.h:66
@ VSF_TRACE_DEBUG
Definition vsf_trace.h:141
@ VSF_TRACE_WARNING
Definition vsf_trace.h:140
@ VSF_TRACE_ERROR
Definition vsf_trace.h:138
@ VSF_TRACE_INFO
Definition vsf_trace.h:139