|
LogIt++
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
2#ifndef _LOGIT_LOG_MACROS_HPP_INCLUDED
3#define _LOGIT_LOG_MACROS_HPP_INCLUDED
10 #define LOGIT_FUNCTION __PRETTY_FUNCTION__
11#elif defined(_MSC_VER)
12 #define LOGIT_FUNCTION __FUNCSIG__
14 #define LOGIT_FUNCTION __func__
20#define LOGIT_STREAM(level) \
21 logit::LogStream(level, logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, LOGIT_FUNCTION, -1)
23#define LOGIT_STREAM_WITH_INDEX(level, index) \
24 logit::LogStream(level, logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, LOGIT_FUNCTION, index)
26#define LOGIT_STREAM_TRACE() LOGIT_STREAM(logit::LogLevel::LOG_LVL_TRACE)
27#define LOGIT_STREAM_DEBUG() LOGIT_STREAM(logit::LogLevel::LOG_LVL_DEBUG)
28#define LOGIT_STREAM_INFO() LOGIT_STREAM(logit::LogLevel::LOG_LVL_INFO)
29#define LOGIT_STREAM_WARN() LOGIT_STREAM(logit::LogLevel::LOG_LVL_WARN)
30#define LOGIT_STREAM_ERROR() LOGIT_STREAM(logit::LogLevel::LOG_LVL_ERROR)
31#define LOGIT_STREAM_FATAL() LOGIT_STREAM(logit::LogLevel::LOG_LVL_FATAL)
33#define LOGIT_STREAM_TRACE_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index)
34#define LOGIT_STREAM_DEBUG_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index)
35#define LOGIT_STREAM_INFO_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index)
36#define LOGIT_STREAM_WARN_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index)
37#define LOGIT_STREAM_ERROR_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index)
38#define LOGIT_STREAM_FATAL_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index)
40#if defined(LOGIT_SHORT_NAME)
43#define LOG_S_TRACE() LOGIT_STREAM_TRACE()
44#define LOG_S_DEBUG() LOGIT_STREAM_DEBUG()
45#define LOG_S_INFO() LOGIT_STREAM_INFO()
46#define LOG_S_WARN() LOGIT_STREAM_WARN()
47#define LOG_S_ERROR() LOGIT_STREAM_ERROR()
48#define LOG_S_FATAL() LOGIT_STREAM_FATAL()
50#define LOG_S_TRACE_TO(index) LOGIT_STREAM_TRACE_TO(index)
51#define LOG_S_DEBUG_TO(index) LOGIT_STREAM_DEBUG_TO(index)
52#define LOG_S_INFO_TO(index) LOGIT_STREAM_INFO_TO(index)
53#define LOG_S_WARN_TO(index) LOGIT_STREAM_WARN_TO(index)
54#define LOG_S_ERROR_TO(index) LOGIT_STREAM_ERROR_TO(index)
55#define LOG_S_FATAL_TO(index) LOGIT_STREAM_FATAL_TO(index)
65#define LOGIT_LOG_AND_RETURN_NOARGS(level, format) \
66 logit::Logger::get_instance().log_and_return( \
67 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
68 logit::make_relative(__FILE__, LOGIT_BASE_PATH), \
69 __LINE__, LOGIT_FUNCTION, format, {}, -1, false})
75#define LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(level, index, format) \
76 logit::Logger::get_instance().log_and_return( \
77 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
78 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
79 LOGIT_FUNCTION, format, {}, index})
89#define LOGIT_LOG_AND_RETURN(level, format, arg_names, ...) \
90 logit::Logger::get_instance().log_and_return( \
91 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
92 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
93 LOGIT_FUNCTION, format, arg_names, -1, false}, __VA_ARGS__)
100#define LOGIT_LOG_AND_RETURN_PRINT(level, arg_names, ...) \
101 logit::Logger::get_instance().log_and_return( \
102 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
103 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
104 LOGIT_FUNCTION, {}, arg_names, -1, true}, __VA_ARGS__)
112#define LOGIT_LOG_AND_RETURN_WITH_INDEX(level, index, format, arg_names, ...) \
113 logit::Logger::get_instance().log_and_return( \
114 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
115 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
116 LOGIT_FUNCTION, format, arg_names, index, false}, __VA_ARGS__)
124#define LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(level, index, arg_names, ...) \
125 logit::Logger::get_instance().log_and_return( \
126 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
127 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
128 LOGIT_FUNCTION, {}, arg_names, index, true}, __VA_ARGS__)
134#define LOGIT_TRACE(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, {}, #__VA_ARGS__, __VA_ARGS__)
135#define LOGIT_TRACE0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
136#define LOGIT_0TRACE() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
137#define LOGIT_0_TRACE() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
138#define LOGIT_NOARGS_TRACE() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
139#define LOGIT_FORMAT_TRACE(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, fmt, #__VA_ARGS__, __VA_ARGS__)
140#define LOGIT_PRINT_TRACE(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_TRACE, #__VA_ARGS__, __VA_ARGS__)
141#define LOGIT_PRINTF_TRACE(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, logit::format(fmt, __VA_ARGS__))
144#define LOGIT_TRACE_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {}, #__VA_ARGS__, __VA_ARGS__)
145#define LOGIT_TRACE0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {})
146#define LOGIT_0TRACE_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {})
147#define LOGIT_0_TRACE_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {})
148#define LOGIT_NOARGS_TRACE_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {})
149#define LOGIT_FORMAT_TRACE_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, fmt, #__VA_ARGS__, __VA_ARGS__)
150#define LOGIT_PRINT_TRACE_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, #__VA_ARGS__, __VA_ARGS__)
151#define LOGIT_PRINTF_TRACE_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, logit::format(fmt, __VA_ARGS__))
154#define LOGIT_INFO(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, {}, #__VA_ARGS__, __VA_ARGS__)
155#define LOGIT_INFO0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
156#define LOGIT_0INFO() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
157#define LOGIT_0_INFO() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
158#define LOGIT_NOARGS_INFO() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
159#define LOGIT_FORMAT_INFO(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, fmt, #__VA_ARGS__, __VA_ARGS__)
160#define LOGIT_PRINT_INFO(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_INFO, #__VA_ARGS__, __VA_ARGS__)
161#define LOGIT_PRINTF_INFO(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, logit::format(fmt, __VA_ARGS__))
164#define LOGIT_INFO_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {}, #__VA_ARGS__, __VA_ARGS__)
165#define LOGIT_INFO0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {})
166#define LOGIT_0INFO_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {})
167#define LOGIT_0_INFO_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {})
168#define LOGIT_NOARGS_INFO_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {})
169#define LOGIT_FORMAT_INFO_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, fmt, #__VA_ARGS__, __VA_ARGS__)
170#define LOGIT_PRINT_INFO_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, #__VA_ARGS__, __VA_ARGS__)
171#define LOGIT_PRINTF_INFO_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, logit::format(fmt, __VA_ARGS__))
174#define LOGIT_DEBUG(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, {}, #__VA_ARGS__, __VA_ARGS__)
175#define LOGIT_DEBUG0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
176#define LOGIT_0DEBUG() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
177#define LOGIT_0_DEBUG() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
178#define LOGIT_NOARGS_DEBUG() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
179#define LOGIT_FORMAT_DEBUG(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, fmt, #__VA_ARGS__, __VA_ARGS__)
180#define LOGIT_PRINT_DEBUG(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_DEBUG, #__VA_ARGS__, __VA_ARGS__)
181#define LOGIT_PRINTF_DEBUG(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, logit::format(fmt, __VA_ARGS__))
184#define LOGIT_DEBUG_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {}, #__VA_ARGS__, __VA_ARGS__)
185#define LOGIT_DEBUG0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {})
186#define LOGIT_0DEBUG_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {})
187#define LOGIT_0_DEBUG_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {})
188#define LOGIT_NOARGS_DEBUG_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {})
189#define LOGIT_FORMAT_DEBUG_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, fmt, #__VA_ARGS__, __VA_ARGS__)
190#define LOGIT_PRINT_DEBUG_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, #__VA_ARGS__, __VA_ARGS__)
191#define LOGIT_PRINTF_DEBUG_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, logit::format(fmt, __VA_ARGS__))
194#define LOGIT_WARN(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, {}, #__VA_ARGS__, __VA_ARGS__)
195#define LOGIT_WARN0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
196#define LOGIT_0WARN() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
197#define LOGIT_0_WARN() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
198#define LOGIT_NOARGS_WARN() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
199#define LOGIT_FORMAT_WARN(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, fmt, #__VA_ARGS__, __VA_ARGS__)
200#define LOGIT_PRINT_WARN(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_WARN, #__VA_ARGS__, __VA_ARGS__)
201#define LOGIT_PRINTF_WARN(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, logit::format(fmt, __VA_ARGS__))
204#define LOGIT_WARN_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {}, #__VA_ARGS__, __VA_ARGS__)
205#define LOGIT_WARN0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {})
206#define LOGIT_0WARN_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {})
207#define LOGIT_0_WARN_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {})
208#define LOGIT_NOARGS_WARN_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {})
209#define LOGIT_FORMAT_WARN_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, fmt, #__VA_ARGS__, __VA_ARGS__)
210#define LOGIT_PRINT_WARN_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, #__VA_ARGS__, __VA_ARGS__)
211#define LOGIT_PRINTF_WARN_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, logit::format(fmt, __VA_ARGS__))
214#define LOGIT_ERROR(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, {}, #__VA_ARGS__, __VA_ARGS__)
215#define LOGIT_ERROR0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
216#define LOGIT_0ERROR() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
217#define LOGIT_0_ERROR() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
218#define LOGIT_NOARGS_ERROR() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
219#define LOGIT_FORMAT_ERROR(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, fmt, #__VA_ARGS__, __VA_ARGS__)
220#define LOGIT_PRINT_ERROR(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_ERROR, #__VA_ARGS__, __VA_ARGS__)
221#define LOGIT_PRINTF_ERROR(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, logit::format(fmt, __VA_ARGS__))
224#define LOGIT_ERROR_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {}, #__VA_ARGS__, __VA_ARGS__)
225#define LOGIT_ERROR0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {})
226#define LOGIT_0ERROR_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {})
227#define LOGIT_0_ERROR_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {})
228#define LOGIT_NOARGS_ERROR_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {})
229#define LOGIT_FORMAT_ERROR_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, fmt, #__VA_ARGS__, __VA_ARGS__)
230#define LOGIT_PRINT_ERROR_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, #__VA_ARGS__, __VA_ARGS__)
231#define LOGIT_PRINTF_ERROR_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, logit::format(fmt, __VA_ARGS__))
234#define LOGIT_FATAL(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, {}, #__VA_ARGS__, __VA_ARGS__)
235#define LOGIT_FATAL0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
236#define LOGIT_0FATAL() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
237#define LOGIT_0_FATAL() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
238#define LOGIT_NOARGS_FATAL() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
239#define LOGIT_FORMAT_FATAL(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, fmt, #__VA_ARGS__, __VA_ARGS__)
240#define LOGIT_PRINT_FATAL(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_FATAL, #__VA_ARGS__, __VA_ARGS__)
241#define LOGIT_PRINTF_FATAL(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, logit::format(fmt, __VA_ARGS__))
244#define LOGIT_FATAL_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {}, #__VA_ARGS__, __VA_ARGS__)
245#define LOGIT_FATAL0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {})
246#define LOGIT_0FATAL_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {})
247#define LOGIT_0_FATAL_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {})
248#define LOGIT_NOARGS_FATAL_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {})
249#define LOGIT_FORMAT_FATAL_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, fmt, #__VA_ARGS__, __VA_ARGS__)
250#define LOGIT_PRINT_FATAL_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, #__VA_ARGS__, __VA_ARGS__)
251#define LOGIT_PRINTF_FATAL_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, logit::format(fmt, __VA_ARGS__))
257#define LOGIT_TRACE_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, {}, #__VA_ARGS__, __VA_ARGS__)
258#define LOGIT_TRACE0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
259#define LOGIT_0TRACE_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
260#define LOGIT_0_TRACE_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
261#define LOGIT_NOARGS_TRACE_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
262#define LOGIT_FORMAT_TRACE_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, fmt, #__VA_ARGS__, __VA_ARGS__)
263#define LOGIT_PRINT_TRACE_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, fmt)
264#define LOGIT_PRINTF_TRACE_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, logit::format(fmt, __VA_ARGS__))
267#define LOGIT_INFO_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, {}, #__VA_ARGS__, __VA_ARGS__)
268#define LOGIT_INFO0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
269#define LOGIT_0INFO_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
270#define LOGIT_0_INFO_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
271#define LOGIT_NOARGS_INFO_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
272#define LOGIT_FORMAT_INFO_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, fmt, #__VA_ARGS__, __VA_ARGS__)
273#define LOGIT_PRINT_INFO_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, fmt)
274#define LOGIT_PRINTF_INFO_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, logit::format(fmt, __VA_ARGS__))
277#define LOGIT_DEBUG_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, {}, #__VA_ARGS__, __VA_ARGS__)
278#define LOGIT_DEBUG0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
279#define LOGIT_0DEBUG_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
280#define LOGIT_0_DEBUG_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
281#define LOGIT_NOARGS_DEBUG_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
282#define LOGIT_FORMAT_DEBUG_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, fmt, #__VA_ARGS__, __VA_ARGS__)
283#define LOGIT_PRINT_DEBUG_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, fmt)
284#define LOGIT_PRINTF_DEBUG_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, logit::format(fmt, __VA_ARGS__))
287#define LOGIT_WARN_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, {}, #__VA_ARGS__, __VA_ARGS__)
288#define LOGIT_WARN0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
289#define LOGIT_0WARN_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
290#define LOGIT_0_WARN_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
291#define LOGIT_NOARGS_WARN_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
292#define LOGIT_FORMAT_WARN_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, fmt, #__VA_ARGS__, __VA_ARGS__)
293#define LOGIT_PRINT_WARN_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, fmt)
294#define LOGIT_PRINTF_WARN_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, logit::format(fmt, __VA_ARGS__))
297#define LOGIT_ERROR_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, {}, #__VA_ARGS__, __VA_ARGS__)
298#define LOGIT_ERROR0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
299#define LOGIT_0ERROR_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
300#define LOGIT_0_ERROR_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
301#define LOGIT_NOARGS_ERROR_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
302#define LOGIT_FORMAT_ERROR_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, fmt, #__VA_ARGS__, __VA_ARGS__)
303#define LOGIT_PRINT_ERROR_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, fmt)
304#define LOGIT_PRINTF_ERROR_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, logit::format(fmt, __VA_ARGS__))
307#define LOGIT_FATAL_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, {}, #__VA_ARGS__, __VA_ARGS__)
308#define LOGIT_FATAL0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
309#define LOGIT_0FATAL_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
310#define LOGIT_0_FATAL_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
311#define LOGIT_NOARGS_FATAL_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
312#define LOGIT_FORMAT_FATAL_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, fmt, #__VA_ARGS__, __VA_ARGS__)
313#define LOGIT_PRINT_FATAL_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, fmt)
314#define LOGIT_PRINTF_FATAL_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, logit::format(fmt, __VA_ARGS__))
318#if defined(LOGIT_SHORT_NAME)
321#define LOG_T(...) LOGIT_TRACE(__VA_ARGS__)
322#define LOG_T0() LOGIT_TRACE0()
323#define LOG_0T() LOGIT_TRACE0()
324#define LOG_0_T() LOGIT_TRACE0()
325#define LOG_T_NOARGS() LOGIT_NOARGS_TRACE()
326#define LOG_NOARGS_T() LOGIT_NOARGS_TRACE()
327#define LOG_TF(fmt, ...) LOGIT_FORMAT_TRACE(fmt, __VA_ARGS__)
328#define LOG_FT(fmt, ...) LOGIT_FORMAT_TRACE(fmt, __VA_ARGS__)
329#define LOG_T_PRINT(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
330#define LOG_PRINT_T(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
331#define LOG_T_PRINTF(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
332#define LOG_PRINTF_T(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
333#define LOG_TP(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
334#define LOG_PT(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
335#define LOG_TPF(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
336#define LOG_PFT(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
338#define LOG_TRACE(...) LOGIT_TRACE(__VA_ARGS__)
339#define LOG_TRACE0() LOGIT_TRACE0()
340#define LOG_0TRACE() LOGIT_TRACE0()
341#define LOG_0_TRACE() LOGIT_TRACE0()
342#define LOG_TRACE_NOARGS() LOGIT_NOARGS_TRACE()
343#define LOG_NOARGS_TRACE() LOGIT_NOARGS_TRACE()
344#define LOG_TRACEF(fmt, ...) LOGIT_FORMAT_TRACE(fmt, __VA_ARGS__)
345#define LOG_FTRACE(fmt, ...) LOGIT_FORMAT_TRACE(fmt, __VA_ARGS__)
346#define LOG_TRACE_PRINT(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
347#define LOG_PRINT_TRACE(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
348#define LOG_TRACE_PRINTF(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
349#define LOG_PRINTF_TRACE(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
352#define LOG_I(...) LOGIT_INFO(__VA_ARGS__)
353#define LOG_I0() LOGIT_INFO0()
354#define LOG_0I() LOGIT_INFO0()
355#define LOG_0_I() LOGIT_INFO0()
356#define LOG_I_NOARGS() LOGIT_NOARGS_INFO()
357#define LOG_NOARGS_I() LOGIT_NOARGS_INFO()
358#define LOG_IF(fmt, ...) LOGIT_FORMAT_INFO(fmt, __VA_ARGS__)
359#define LOG_FI(fmt, ...) LOGIT_FORMAT_INFO(fmt, __VA_ARGS__)
360#define LOG_I_PRINT(...) LOGIT_PRINT_INFO(__VA_ARGS__)
361#define LOG_PRINT_I(...) LOGIT_PRINT_INFO(__VA_ARGS__)
362#define LOG_I_PRINTF(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
363#define LOG_PRINTF_I(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
364#define LOG_IP(...) LOGIT_PRINT_INFO(__VA_ARGS__)
365#define LOG_PI(...) LOGIT_PRINT_INFO(__VA_ARGS__)
366#define LOG_IPF(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
367#define LOG_PFI(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
369#define LOG_INFO(...) LOGIT_INFO(__VA_ARGS__)
370#define LOG_INFO0() LOGIT_INFO0()
371#define LOG_0INFO() LOGIT_INFO0()
372#define LOG_0_INFO() LOGIT_INFO0()
373#define LOG_INFO_NOARGS() LOGIT_NOARGS_INFO()
374#define LOG_NOARGS_INFO() LOGIT_NOARGS_INFO()
375#define LOG_INFOF(fmt, ...) LOGIT_FORMAT_INFO(fmt, __VA_ARGS__)
376#define LOG_FINFO(fmt, ...) LOGIT_FORMAT_INFO(fmt, __VA_ARGS__)
377#define LOG_INFO_PRINT(...) LOGIT_PRINT_INFO(__VA_ARGS__)
378#define LOG_PRINT_INFO(...) LOGIT_PRINT_INFO(__VA_ARGS__)
379#define LOG_INFO_PRINTF(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
380#define LOG_PRINTF_INFO(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
383#define LOG_D(...) LOGIT_DEBUG(__VA_ARGS__)
384#define LOG_D0() LOGIT_DEBUG0()
385#define LOG_0D() LOGIT_DEBUG0()
386#define LOG_0_D() LOGIT_DEBUG0()
387#define LOG_D_NOARGS() LOGIT_NOARGS_DEBUG()
388#define LOG_NOARGS_D() LOGIT_NOARGS_DEBUG()
389#define LOG_DF(fmt, ...) LOGIT_FORMAT_DEBUG(fmt, __VA_ARGS__)
390#define LOG_FD(fmt, ...) LOGIT_FORMAT_DEBUG(fmt, __VA_ARGS__)
391#define LOG_D_PRINT(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
392#define LOG_PRINT_D(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
393#define LOG_D_PRINTF(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
394#define LOG_PRINTF_D(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
395#define LOG_DP(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
396#define LOG_PD(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
397#define LOG_DPF(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
398#define LOG_PFD(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
400#define LOG_DEBUG(...) LOGIT_DEBUG(__VA_ARGS__)
401#define LOG_DEBUG0() LOGIT_DEBUG0()
402#define LOG_0DEBUG() LOGIT_DEBUG0()
403#define LOG_0_DEBUG() LOGIT_DEBUG0()
404#define LOG_DEBUG_NOARGS() LOGIT_NOARGS_DEBUG()
405#define LOG_NOARGS_DEBUG() LOGIT_NOARGS_DEBUG()
406#define LOG_DEBUGF(fmt, ...) LOGIT_FORMAT_DEBUG(fmt, __VA_ARGS__)
407#define LOG_FDEBUG(fmt, ...) LOGIT_FORMAT_DEBUG(fmt, __VA_ARGS__)
408#define LOG_DEBUG_PRINT(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
409#define LOG_PRINT_DEBUG(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
410#define LOG_DEBUG_PRINTF(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
411#define LOG_PRINTF_DEBUG(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
414#define LOG_W(...) LOGIT_WARN(__VA_ARGS__)
415#define LOG_W0() LOGIT_WARN0()
416#define LOG_0W() LOGIT_WARN0()
417#define LOG_0_W() LOGIT_WARN0()
418#define LOG_W_NOARGS() LOGIT_NOARGS_WARN()
419#define LOG_NOARGS_W() LOGIT_NOARGS_WARN()
420#define LOG_WF(fmt, ...) LOGIT_FORMAT_WARN(fmt, __VA_ARGS__)
421#define LOG_FW(fmt, ...) LOGIT_FORMAT_WARN(fmt, __VA_ARGS__)
422#define LOG_W_PRINT(...) LOGIT_PRINT_WARN(__VA_ARGS__)
423#define LOG_PRINT_W(...) LOGIT_PRINT_WARN(__VA_ARGS__)
424#define LOG_W_PRINTF(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
425#define LOG_PRINTF_W(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
426#define LOG_WP(...) LOGIT_PRINT_WARN(__VA_ARGS__)
427#define LOG_PW(...) LOGIT_PRINT_WARN(__VA_ARGS__)
428#define LOG_WPF(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
429#define LOG_PFW(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
431#define LOG_WARN(...) LOGIT_WARN(__VA_ARGS__)
432#define LOG_WARN0() LOGIT_WARN0()
433#define LOG_0WARN() LOGIT_WARN0()
434#define LOG_0_WARN() LOGIT_WARN0()
435#define LOG_WARN_NOARGS() LOGIT_NOARGS_WARN()
436#define LOG_NOARGS_WARN() LOGIT_NOARGS_WARN()
437#define LOG_WARNF(fmt, ...) LOGIT_FORMAT_WARN(fmt, __VA_ARGS__)
438#define LOG_FWARN(fmt, ...) LOGIT_FORMAT_WARN(fmt, __VA_ARGS__)
439#define LOG_WARN_PRINT(...) LOGIT_PRINT_WARN(__VA_ARGS__)
440#define LOG_PRINT_WARN(...) LOGIT_PRINT_WARN(__VA_ARGS__)
441#define LOG_WARN_PRINTF(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
442#define LOG_PRINTF_WARN(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
445#define LOG_E(...) LOGIT_ERROR(__VA_ARGS__)
446#define LOG_E0() LOGIT_ERROR0()
447#define LOG_0E() LOGIT_ERROR0()
448#define LOG_0_E() LOGIT_ERROR0()
449#define LOG_E_NOARGS() LOGIT_NOARGS_ERROR()
450#define LOG_NOARGS_E() LOGIT_NOARGS_ERROR()
451#define LOG_EF(fmt, ...) LOGIT_FORMAT_ERROR(fmt, __VA_ARGS__)
452#define LOG_FE(fmt, ...) LOGIT_FORMAT_ERROR(fmt, __VA_ARGS__)
453#define LOG_E_PRINT(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
454#define LOG_PRINT_E(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
455#define LOG_E_PRINTF(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
456#define LOG_PRINTF_E(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
457#define LOG_EP(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
458#define LOG_PE(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
459#define LOG_EPF(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
460#define LOG_PFE(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
462#define LOG_ERROR(...) LOGIT_ERROR(__VA_ARGS__)
463#define LOG_ERROR0() LOGIT_ERROR0()
464#define LOG_0ERROR() LOGIT_ERROR0()
465#define LOG_0_ERROR() LOGIT_ERROR0()
466#define LOG_ERROR_NOARGS() LOGIT_NOARGS_ERROR()
467#define LOG_NOARGS_ERROR() LOGIT_NOARGS_ERROR()
468#define LOG_ERRORF(fmt, ...) LOGIT_FORMAT_ERROR(fmt, __VA_ARGS__)
469#define LOG_FERROR(fmt, ...) LOGIT_FORMAT_ERROR(fmt, __VA_ARGS__)
470#define LOG_ERROR_PRINT(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
471#define LOG_PRINT_ERROR(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
472#define LOG_ERROR_PRINTF(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
473#define LOG_PRINTF_ERROR(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
476#define LOG_F(...) LOGIT_FATAL(__VA_ARGS__)
477#define LOG_F0() LOGIT_FATAL0()
478#define LOG_0F() LOGIT_FATAL0()
479#define LOG_0_F() LOGIT_FATAL0()
480#define LOG_F_NOARGS() LOGIT_NOARGS_FATAL()
481#define LOG_NOARGS_F() LOGIT_NOARGS_FATAL()
482#define LOG_FF(fmt, ...) LOGIT_FORMAT_FATAL(fmt, __VA_ARGS__)
483#define LOG_F_PRINT(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
484#define LOG_PRINT_F(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
485#define LOG_F_PRINTF(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
486#define LOG_PRINTF_F(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
487#define LOG_FP(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
488#define LOG_PF(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
489#define LOG_FPF(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
490#define LOG_PFF(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
492#define LOG_FATAL(...) LOGIT_FATAL(__VA_ARGS__)
493#define LOG_FATAL0() LOGIT_FATAL0()
494#define LOG_0FATAL() LOGIT_FATAL0()
495#define LOG_0_FATAL() LOGIT_FATAL0()
496#define LOG_FATAL_NOARGS() LOGIT_NOARGS_FATAL()
497#define LOG_NOARGS_FATAL() LOGIT_NOARGS_FATAL()
498#define LOG_FATALF(fmt, ...) LOGIT_FORMAT_FATAL(fmt, __VA_ARGS__)
499#define LOG_FFATAL(fmt, ...) LOGIT_FORMAT_FATAL(fmt, __VA_ARGS__)
500#define LOG_FATAL_PRINT(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
501#define LOG_PRINT_FATAL(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
502#define LOG_FATAL_PRINTF(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
503#define LOG_PRINTF_FATAL(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
511#if __cplusplus >= 201703L
519#define LOGIT_ADD_LOGGER(logger_type, logger_args, formatter_type, formatter_args) \
520 logit::Logger::get_instance().add_logger( \
521 std::make_unique<logger_type> logger_args, \
522 std::make_unique<formatter_type> formatter_args)
531#define LOGIT_ADD_LOGGER_SINGLE_MODE(logger_type, logger_args, formatter_type, formatter_args) \
532 logit::Logger::get_instance().add_logger( \
533 std::make_unique<logger_type> logger_args, \
534 std::make_unique<formatter_type> formatter_args, \
541#define LOGIT_ADD_CONSOLE(pattern, async) \
542 logit::Logger::get_instance().add_logger( \
543 std::make_unique<logit::ConsoleLogger>(async), \
544 std::make_unique<logit::SimpleLogFormatter>(pattern));
551#define LOGIT_ADD_CONSOLE_SINGLE_MODE(pattern, async) \
552 logit::Logger::get_instance().add_logger( \
553 std::make_unique<logit::ConsoleLogger>(async), \
554 std::make_unique<logit::SimpleLogFormatter>(pattern), \
560#define LOGIT_ADD_CONSOLE_DEFAULT() \
561 logit::Logger::get_instance().add_logger( \
562 std::make_unique<logit::ConsoleLogger>(true), \
563 std::make_unique<logit::SimpleLogFormatter>(LOGIT_CONSOLE_PATTERN));
568#define LOGIT_ADD_CONSOLE_DEFAULT_SINGLE_MODE() \
569 logit::Logger::get_instance().add_logger( \
570 std::make_unique<logit::ConsoleLogger>(true), \
571 std::make_unique<logit::SimpleLogFormatter>(LOGIT_CONSOLE_PATTERN), \
580#define LOGIT_ADD_FILE_LOGGER(directory, async, auto_delete_days, pattern) \
581 logit::Logger::get_instance().add_logger( \
582 std::make_unique<logit::FileLogger>( \
583 directory, async, auto_delete_days), \
584 std::make_unique<logit::SimpleLogFormatter>(pattern));
593#define LOGIT_ADD_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, pattern) \
594 logit::Logger::get_instance().add_logger( \
595 std::make_unique<logit::FileLogger>( \
596 directory, async, auto_delete_days), \
597 std::make_unique<logit::SimpleLogFormatter>(pattern), \
603#define LOGIT_ADD_FILE_LOGGER_DEFAULT() \
604 logit::Logger::get_instance().add_logger( \
605 std::make_unique<logit::FileLogger>( \
606 LOGIT_FILE_LOGGER_PATH, true, \
607 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS), \
608 std::make_unique<logit::SimpleLogFormatter>(LOGIT_FILE_LOGGER_PATTERN));
613#define LOGIT_ADD_FILE_LOGGER_DEFAULT_SINGLE_MODE() \
614 logit::Logger::get_instance().add_logger( \
615 std::make_unique<logit::FileLogger>( \
616 LOGIT_FILE_LOGGER_PATH, true, \
617 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS), \
618 std::make_unique<logit::SimpleLogFormatter>(LOGIT_FILE_LOGGER_PATTERN), \
628#define LOGIT_ADD_UNIQUE_FILE_LOGGER(directory, async, auto_delete_days, hash_length, pattern) \
629 logit::Logger::get_instance().add_logger( \
630 std::make_unique<logit::UniqueFileLogger>( \
631 directory, async, auto_delete_days, hash_length), \
632 std::make_unique<logit::SimpleLogFormatter>(pattern));
642#define LOGIT_ADD_UNIQUE_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, hash_length, pattern) \
643 logit::Logger::get_instance().add_logger( \
644 std::make_unique<logit::UniqueFileLogger>( \
645 directory, async, auto_delete_days, hash_length), \
646 std::make_unique<logit::SimpleLogFormatter>(pattern), \
654#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT() \
655 logit::Logger::get_instance().add_logger( \
656 std::make_unique<logit::UniqueFileLogger>( \
657 LOGIT_UNIQUE_FILE_LOGGER_PATH, true, \
658 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS), \
659 std::make_unique<logit::SimpleLogFormatter>(LOGIT_FILE_LOGGER_PATTERN));
667#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT_SINGLE_MODE() \
668 logit::Logger::get_instance().add_logger( \
669 std::make_unique<logit::UniqueFileLogger>( \
670 LOGIT_UNIQUE_FILE_LOGGER_PATH, true, \
671 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS), \
672 std::make_unique<logit::SimpleLogFormatter>(LOGIT_FILE_LOGGER_PATTERN), \
683#define LOGIT_ADD_LOGGER(logger_type, logger_args, formatter_type, formatter_args) \
684 logit::Logger::get_instance().add_logger( \
685 std::unique_ptr<logger_type>(new logger_type logger_args), \
686 std::unique_ptr<formatter_type>(new formatter_type formatter_args), \
696#define LOGIT_ADD_LOGGER_SINGLE_MODE(logger_type, logger_args, formatter_type, formatter_args) \
697 logit::Logger::get_instance().add_logger( \
698 std::unique_ptr<logger_type>(new logger_type logger_args), \
699 std::unique_ptr<formatter_type>(new formatter_type formatter_args), \
706#define LOGIT_ADD_CONSOLE(pattern, async) \
707 logit::Logger::get_instance().add_logger( \
708 std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(async)), \
709 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
717#define LOGIT_ADD_CONSOLE_SINGLE_MODE(pattern, async) \
718 logit::Logger::get_instance().add_logger( \
719 std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(async)), \
720 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
726#define LOGIT_ADD_CONSOLE_DEFAULT() \
727 logit::Logger::get_instance().add_logger( \
728 std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(true)), \
729 std::unique_ptr<logit::SimpleLogFormatter>( \
730 new logit::SimpleLogFormatter(LOGIT_CONSOLE_PATTERN)), \
736#define LOGIT_ADD_CONSOLE_DEFAULT_SINGLE_MODE() \
737 logit::Logger::get_instance().add_logger( \
738 std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(true)), \
739 std::unique_ptr<logit::SimpleLogFormatter>( \
740 new logit::SimpleLogFormatter(LOGIT_CONSOLE_PATTERN)), \
749#define LOGIT_ADD_FILE_LOGGER(directory, async, auto_delete_days, pattern) \
750 logit::Logger::get_instance().add_logger( \
751 std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
752 directory, async, auto_delete_days)), \
753 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)))
762#define LOGIT_ADD_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, pattern) \
763 logit::Logger::get_instance().add_logger( \
764 std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
765 directory, async, auto_delete_days)), \
766 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
772#define LOGIT_ADD_FILE_LOGGER_DEFAULT() \
773 logit::Logger::get_instance().add_logger( \
774 std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
775 LOGIT_FILE_LOGGER_PATH, true, \
776 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS)), \
777 std::unique_ptr<logit::SimpleLogFormatter>( \
778 new logit::SimpleLogFormatter(LOGIT_FILE_LOGGER_PATTERN)))
783#define LOGIT_ADD_FILE_LOGGER_DEFAULT_SINGLE_MODE() \
784 logit::Logger::get_instance().add_logger( \
785 std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
786 LOGIT_FILE_LOGGER_PATH, true, \
787 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS)), \
788 std::unique_ptr<logit::SimpleLogFormatter>( \
789 new logit::SimpleLogFormatter(LOGIT_FILE_LOGGER_PATTERN)), \
799#define LOGIT_ADD_UNIQUE_FILE_LOGGER(directory, async, auto_delete_days, hash_length, pattern) \
800 logit::Logger::get_instance().add_logger( \
801 std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
802 directory, async, auto_delete_days, hash_length)), \
803 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)))
813#define LOGIT_ADD_UNIQUE_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, hash_length, pattern) \
814 logit::Logger::get_instance().add_logger( \
815 std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
816 directory, async, auto_delete_days, hash_length)), \
817 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
825#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT() \
826 logit::Logger::get_instance().add_logger( \
827 std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
828 LOGIT_UNIQUE_FILE_LOGGER_PATH, true, \
829 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS)), \
830 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(LOGIT_FILE_LOGGER_PATTERN)))
838#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT_SINGLE_MODE() \
839 logit::Logger::get_instance().add_logger( \
840 std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
841 LOGIT_UNIQUE_FILE_LOGGER_PATH, true, \
842 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS)), \
843 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(LOGIT_FILE_LOGGER_PATTERN)), \
852#define LOGIT_GET_STRING_PARAM(logger_index, param) \
853 logit::Logger::get_instance().get_string_param(logger_index, param)
859#define LOGIT_GET_INT_PARAM(logger_index, param) \
860 logit::Logger::get_instance().get_int_param(logger_index, param)
866#define LOGIT_GET_FLOAT_PARAM(logger_index, param) \
867 logit::Logger::get_instance().get_float_param(logger_index, param)
872#define LOGIT_GET_LAST_FILE_NAME(logger_index) \
873 logit::Logger::get_instance().get_string_param(logger_index, logit::LoggerParam::LastFileName)
878#define LOGIT_GET_LAST_FILE_PATH(logger_index) \
879 logit::Logger::get_instance().get_string_param(logger_index, logit::LoggerParam::LastFilePath)
884#define LOGIT_GET_LAST_LOG_TIMESTAMP(logger_index) \
885 logit::Logger::get_instance().get_int_param(logger_index, logit::LoggerParam::LastLogTimestamp)
890#define LOGIT_GET_TIME_SINCE_LAST_LOG(logger_index) \
891 logit::Logger::get_instance().get_float_param(logger_index, logit::LoggerParam::TimeSinceLastLog)
894#define LOGIT_WAIT() logit::Logger::get_instance().wait();