RetroArch
verbosity.h
Go to the documentation of this file.
1 /* RetroArch - A frontend for libretro.
2  * Copyright (C) 2011-2017 - Daniel De Matteis
3  *
4  * RetroArch is free software: you can redistribute it and/or modify it under the terms
5  * of the GNU General Public License as published by the Free Software Found-
6  * ation, either version 3 of the License, or (at your option) any later version.
7  *
8  * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10  * PURPOSE. See the GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License along with RetroArch.
13  * If not, see <http://www.gnu.org/licenses/>.
14  */
15 
16 #ifndef __RARCH_VERBOSITY_H
17 #define __RARCH_VERBOSITY_H
18 
19 #include <stdarg.h>
20 
21 #include <boolean.h>
22 #include <retro_common_api.h>
23 
24 #ifdef HAVE_CONFIG_H
25 #include "config.h"
26 #endif
27 
29 
30 bool verbosity_is_enabled(void);
31 
32 void verbosity_enable(void);
33 
34 void verbosity_disable(void);
35 
36 bool *verbosity_get_ptr(void);
37 
38 void *retro_main_log_file(void);
39 
41 
42 void retro_main_log_file_init(const char *path);
43 
44 #if defined(HAVE_LOGGER)
45 
46 void logger_init (void);
47 void logger_shutdown (void);
48 void logger_send (const char *__format,...);
49 void logger_send_v(const char *__format, va_list args);
50 
51 #ifdef IS_SALAMANDER
52 
53 #define RARCH_LOG(...) do { \
54  logger_send("RetroArch Salamander: " __VA_ARGS__); \
55 } while(0)
56 
57 #define RARCH_LOG_V(tag, fmt, vp) do { \
58  logger_send("RetroArch Salamander: " tag); \
59  logger_send_v(fmt, vp); \
60 } while (0)
61 
62 #define RARCH_LOG_OUTPUT(...) do { \
63  logger_send("[OUTPUT] " __VA_ARGS__); \
64 } while(0)
65 
66 #define RARCH_LOG_OUTPUT_V(tag, fmt, vp) do { \
67  logger_send("[OUTPUT] " tag); \
68  logger_send_v(fmt, vp); \
69 } while (0)
70 
71 #define RARCH_ERR(...) do { \
72  logger_send("[ERROR] " __VA_ARGS__); \
73 } while(0)
74 
75 #define RARCH_ERR_V(tag, fmt, vp) do { \
76  logger_send("[ERROR] " tag); \
77  logger_send_v(fmt, vp); \
78 } while (0)
79 
80 #define RARCH_WARN(...) do { \
81  logger_send("[WARN] " __VA_ARGS__); \
82 } while(0)
83 
84 #define RARCH_WARN_V(tag, fmt, vp) do { \
85  logger_send("[WARN] " tag); \
86  logger_send_v(fmt, vp); \
87 } while (0)
88 
89 #else /* IS_SALAMANDER */
90 
91 #define RARCH_LOG(...) do { \
92  logger_send("" __VA_ARGS__); \
93 } while(0)
94 
95 #define RARCH_LOG_V(tag, fmt, vp) do { \
96  logger_send("" tag); \
97  logger_send_v(fmt, vp); \
98 } while (0)
99 
100 #define RARCH_ERR(...) do { \
101  logger_send("[ERROR] " __VA_ARGS__); \
102 } while(0)
103 
104 #define RARCH_ERR_V(tag, fmt, vp) do { \
105  logger_send("[ERROR] " tag); \
106  logger_send_v(fmt, vp); \
107 } while (0)
108 
109 #define RARCH_WARN(...) do { \
110  logger_send("[WARN] " __VA_ARGS__); \
111 } while(0)
112 
113 #define RARCH_WARN_V(tag, fmt, vp) do { \
114  logger_send("[WARN] :: " tag); \
115  logger_send_v(fmt, vp); \
116 } while (0)
117 
118 #define RARCH_LOG_OUTPUT(...) do { \
119  logger_send("[OUTPUT] " __VA_ARGS__); \
120 } while(0)
121 
122 #define RARCH_LOG_OUTPUT_V(tag, fmt, vp) do { \
123  logger_send("[OUTPUT] " tag); \
124  logger_send_v(fmt, vp); \
125 } while (0)
126 #endif
127 
128 #define RARCH_LOG_BUFFER(...) do { } while(0)
129 
130 #else /* HAVE_LOGGER */
131 void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap);
132 void RARCH_LOG(const char *fmt, ...);
133 void RARCH_LOG_BUFFER(uint8_t *buffer, size_t size);
134 void RARCH_LOG_OUTPUT(const char *msg, ...);
135 void RARCH_WARN(const char *fmt, ...);
136 void RARCH_ERR(const char *fmt, ...);
137 
138 #define RARCH_LOG_OUTPUT_V RARCH_LOG_V
139 #define RARCH_WARN_V RARCH_LOG_V
140 #define RARCH_ERR_V RARCH_LOG_V
141 #endif /* HAVE_LOGGER */
142 
144 
145 #endif
void retro_main_log_file_init(const char *path)
Definition: verbosity.c:109
void * retro_main_log_file(void)
Definition: verbosity.c:104
static const unsigned char tag[MAX_TESTS *3][16]
Definition: gcm.c:696
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
Configuration options (set of defines)
GLsizei const GLchar ** path
Definition: glext.h:7901
GLsizeiptr size
Definition: glext.h:6559
void RARCH_WARN(const char *fmt,...)
Definition: verbosity.c:301
void logger_init(void)
Definition: net_logger.c:43
void RARCH_LOG_BUFFER(uint8_t *buffer, size_t size)
Definition: verbosity.c:249
void RARCH_LOG(const char *fmt,...)
Definition: verbosity.c:281
void verbosity_disable(void)
Definition: verbosity.c:85
static const unsigned char msg[]
Definition: ccm.c:375
dictionary args
Definition: test_shaders.py:20
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
void verbosity_enable(void)
Definition: verbosity.c:76
void logger_send_v(const char *__format, va_list args)
Definition: net_logger.c:85
void retro_main_log_file_deinit(void)
Definition: verbosity.c:133
void logger_shutdown(void)
Definition: net_logger.c:68
bool * verbosity_get_ptr(void)
Definition: verbosity.c:99
RETRO_BEGIN_DECLS bool verbosity_is_enabled(void)
Definition: verbosity.c:94
void RARCH_LOG_OUTPUT(const char *msg,...)
Definition: verbosity.c:293
void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
Definition: verbosity.c:146
void logger_send(const char *__format,...)
Definition: net_logger.c:76
Definition: video4linux2.c:51
void RARCH_ERR(const char *fmt,...)
Definition: verbosity.c:313
unsigned char uint8_t
Definition: stdint.h:124