|
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
46 #define LOGIT_FUNCTION __PRETTY_FUNCTION__
47#elif defined(_MSC_VER)
48 #define LOGIT_FUNCTION __FUNCSIG__
50 #define LOGIT_FUNCTION __func__
53#define LOGIT_ENUM_TO_STR_CASE(value) case value: return #value;
63#define LOGIT_STREAM(level) \
64 logit::LogStream(level, logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, LOGIT_FUNCTION, -1)
67#define LOGIT_STREAM_WITH_INDEX(level, index) \
68 logit::LogStream(level, logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, LOGIT_FUNCTION, index)
70#define LOGIT_STREAM_TRACE() LOGIT_STREAM(logit::LogLevel::LOG_LVL_TRACE)
71#define LOGIT_STREAM_DEBUG() LOGIT_STREAM(logit::LogLevel::LOG_LVL_DEBUG)
72#define LOGIT_STREAM_INFO() LOGIT_STREAM(logit::LogLevel::LOG_LVL_INFO)
73#define LOGIT_STREAM_WARN() LOGIT_STREAM(logit::LogLevel::LOG_LVL_WARN)
74#define LOGIT_STREAM_ERROR() LOGIT_STREAM(logit::LogLevel::LOG_LVL_ERROR)
75#define LOGIT_STREAM_FATAL() LOGIT_STREAM(logit::LogLevel::LOG_LVL_FATAL)
77#define LOGIT_STREAM_TRACE_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index)
78#define LOGIT_STREAM_DEBUG_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index)
79#define LOGIT_STREAM_INFO_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index)
80#define LOGIT_STREAM_WARN_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index)
81#define LOGIT_STREAM_ERROR_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index)
82#define LOGIT_STREAM_FATAL_TO(index) LOGIT_STREAM_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index)
84#if defined(LOGIT_SHORT_NAME)
87#define LOG_S_TRACE() LOGIT_STREAM_TRACE()
88#define LOG_S_DEBUG() LOGIT_STREAM_DEBUG()
89#define LOG_S_INFO() LOGIT_STREAM_INFO()
90#define LOG_S_WARN() LOGIT_STREAM_WARN()
91#define LOG_S_ERROR() LOGIT_STREAM_ERROR()
92#define LOG_S_FATAL() LOGIT_STREAM_FATAL()
94#define LOG_S_TRACE_TO(index) LOGIT_STREAM_TRACE_TO(index)
95#define LOG_S_DEBUG_TO(index) LOGIT_STREAM_DEBUG_TO(index)
96#define LOG_S_INFO_TO(index) LOGIT_STREAM_INFO_TO(index)
97#define LOG_S_WARN_TO(index) LOGIT_STREAM_WARN_TO(index)
98#define LOG_S_ERROR_TO(index) LOGIT_STREAM_ERROR_TO(index)
99#define LOG_S_FATAL_TO(index) LOGIT_STREAM_FATAL_TO(index)
111#define LOGIT_LOG_AND_RETURN_NOARGS(level, format) \
112 logit::Logger::get_instance().log_and_return( \
113 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
114 logit::make_relative(__FILE__, LOGIT_BASE_PATH), \
115 __LINE__, LOGIT_FUNCTION, format, {}, -1, false})
121#define LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(level, index, format) \
122 logit::Logger::get_instance().log_and_return( \
123 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
124 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
125 LOGIT_FUNCTION, format, {}, index})
135#define LOGIT_LOG_AND_RETURN(level, format, arg_names, ...) \
136 logit::Logger::get_instance().log_and_return( \
137 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
138 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
139 LOGIT_FUNCTION, format, arg_names, -1, false}, __VA_ARGS__)
146#define LOGIT_LOG_AND_RETURN_PRINT(level, arg_names, ...) \
147 logit::Logger::get_instance().log_and_return( \
148 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
149 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
150 LOGIT_FUNCTION, {}, arg_names, -1, true}, __VA_ARGS__)
158#define LOGIT_LOG_AND_RETURN_WITH_INDEX(level, index, format, arg_names, ...) \
159 logit::Logger::get_instance().log_and_return( \
160 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
161 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
162 LOGIT_FUNCTION, format, arg_names, index, false}, __VA_ARGS__)
170#define LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(level, index, arg_names, ...) \
171 logit::Logger::get_instance().log_and_return( \
172 logit::LogRecord{level, LOGIT_CURRENT_TIMESTAMP_MS(), \
173 logit::make_relative(__FILE__, LOGIT_BASE_PATH), __LINE__, \
174 LOGIT_FUNCTION, {}, arg_names, index, true}, __VA_ARGS__)
180#define LOGIT_TRACE(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, {}, #__VA_ARGS__, __VA_ARGS__)
181#define LOGIT_TRACE0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
182#define LOGIT_0TRACE() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
183#define LOGIT_0_TRACE() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
184#define LOGIT_NOARGS_TRACE() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
185#define LOGIT_FORMAT_TRACE(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, fmt, #__VA_ARGS__, __VA_ARGS__)
186#define LOGIT_PRINT_TRACE(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_TRACE, #__VA_ARGS__, __VA_ARGS__)
187#define LOGIT_PRINTF_TRACE(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, logit::format(fmt, __VA_ARGS__))
190#define LOGIT_TRACE_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {}, #__VA_ARGS__, __VA_ARGS__)
191#define LOGIT_TRACE0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {})
192#define LOGIT_0TRACE_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {})
193#define LOGIT_0_TRACE_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {})
194#define LOGIT_NOARGS_TRACE_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, {})
195#define LOGIT_FORMAT_TRACE_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, fmt, #__VA_ARGS__, __VA_ARGS__)
196#define LOGIT_PRINT_TRACE_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_TRACE, index, #__VA_ARGS__, __VA_ARGS__)
197#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__))
200#define LOGIT_INFO(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, {}, #__VA_ARGS__, __VA_ARGS__)
201#define LOGIT_INFO0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
202#define LOGIT_0INFO() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
203#define LOGIT_0_INFO() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
204#define LOGIT_NOARGS_INFO() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
205#define LOGIT_FORMAT_INFO(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, fmt, #__VA_ARGS__, __VA_ARGS__)
206#define LOGIT_PRINT_INFO(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_INFO, #__VA_ARGS__, __VA_ARGS__)
207#define LOGIT_PRINTF_INFO(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, logit::format(fmt, __VA_ARGS__))
210#define LOGIT_INFO_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {}, #__VA_ARGS__, __VA_ARGS__)
211#define LOGIT_INFO0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {})
212#define LOGIT_0INFO_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {})
213#define LOGIT_0_INFO_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {})
214#define LOGIT_NOARGS_INFO_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, {})
215#define LOGIT_FORMAT_INFO_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, fmt, #__VA_ARGS__, __VA_ARGS__)
216#define LOGIT_PRINT_INFO_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_INFO, index, #__VA_ARGS__, __VA_ARGS__)
217#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__))
220#define LOGIT_DEBUG(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, {}, #__VA_ARGS__, __VA_ARGS__)
221#define LOGIT_DEBUG0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
222#define LOGIT_0DEBUG() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
223#define LOGIT_0_DEBUG() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
224#define LOGIT_NOARGS_DEBUG() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
225#define LOGIT_FORMAT_DEBUG(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, fmt, #__VA_ARGS__, __VA_ARGS__)
226#define LOGIT_PRINT_DEBUG(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_DEBUG, #__VA_ARGS__, __VA_ARGS__)
227#define LOGIT_PRINTF_DEBUG(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, logit::format(fmt, __VA_ARGS__))
230#define LOGIT_DEBUG_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {}, #__VA_ARGS__, __VA_ARGS__)
231#define LOGIT_DEBUG0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {})
232#define LOGIT_0DEBUG_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {})
233#define LOGIT_0_DEBUG_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {})
234#define LOGIT_NOARGS_DEBUG_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, {})
235#define LOGIT_FORMAT_DEBUG_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, fmt, #__VA_ARGS__, __VA_ARGS__)
236#define LOGIT_PRINT_DEBUG_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_DEBUG, index, #__VA_ARGS__, __VA_ARGS__)
237#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__))
240#define LOGIT_WARN(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, {}, #__VA_ARGS__, __VA_ARGS__)
241#define LOGIT_WARN0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
242#define LOGIT_0WARN() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
243#define LOGIT_0_WARN() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
244#define LOGIT_NOARGS_WARN() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
245#define LOGIT_FORMAT_WARN(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, fmt, #__VA_ARGS__, __VA_ARGS__)
246#define LOGIT_PRINT_WARN(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_WARN, #__VA_ARGS__, __VA_ARGS__)
247#define LOGIT_PRINTF_WARN(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, logit::format(fmt, __VA_ARGS__))
250#define LOGIT_WARN_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {}, #__VA_ARGS__, __VA_ARGS__)
251#define LOGIT_WARN0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {})
252#define LOGIT_0WARN_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {})
253#define LOGIT_0_WARN_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {})
254#define LOGIT_NOARGS_WARN_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, {})
255#define LOGIT_FORMAT_WARN_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, fmt, #__VA_ARGS__, __VA_ARGS__)
256#define LOGIT_PRINT_WARN_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_WARN, index, #__VA_ARGS__, __VA_ARGS__)
257#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__))
260#define LOGIT_ERROR(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, {}, #__VA_ARGS__, __VA_ARGS__)
261#define LOGIT_ERROR0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
262#define LOGIT_0ERROR() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
263#define LOGIT_0_ERROR() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
264#define LOGIT_NOARGS_ERROR() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
265#define LOGIT_FORMAT_ERROR(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, fmt, #__VA_ARGS__, __VA_ARGS__)
266#define LOGIT_PRINT_ERROR(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_ERROR, #__VA_ARGS__, __VA_ARGS__)
267#define LOGIT_PRINTF_ERROR(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, logit::format(fmt, __VA_ARGS__))
270#define LOGIT_ERROR_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {}, #__VA_ARGS__, __VA_ARGS__)
271#define LOGIT_ERROR0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {})
272#define LOGIT_0ERROR_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {})
273#define LOGIT_0_ERROR_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {})
274#define LOGIT_NOARGS_ERROR_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, {})
275#define LOGIT_FORMAT_ERROR_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, fmt, #__VA_ARGS__, __VA_ARGS__)
276#define LOGIT_PRINT_ERROR_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_ERROR, index, #__VA_ARGS__, __VA_ARGS__)
277#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__))
280#define LOGIT_FATAL(...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, {}, #__VA_ARGS__, __VA_ARGS__)
281#define LOGIT_FATAL0() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
282#define LOGIT_0FATAL() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
283#define LOGIT_0_FATAL() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
284#define LOGIT_NOARGS_FATAL() LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
285#define LOGIT_FORMAT_FATAL(fmt, ...) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, fmt, #__VA_ARGS__, __VA_ARGS__)
286#define LOGIT_PRINT_FATAL(...) LOGIT_LOG_AND_RETURN_PRINT(logit::LogLevel::LOG_LVL_FATAL, #__VA_ARGS__, __VA_ARGS__)
287#define LOGIT_PRINTF_FATAL(fmt, ...) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, logit::format(fmt, __VA_ARGS__))
290#define LOGIT_FATAL_TO(index, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {}, #__VA_ARGS__, __VA_ARGS__)
291#define LOGIT_FATAL0_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {})
292#define LOGIT_0FATAL_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {})
293#define LOGIT_0_FATAL_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {})
294#define LOGIT_NOARGS_FATAL_TO(index) LOGIT_LOG_AND_RETURN_NOARGS_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, {})
295#define LOGIT_FORMAT_FATAL_TO(index, fmt, ...) LOGIT_LOG_AND_RETURN_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, fmt, #__VA_ARGS__, __VA_ARGS__)
296#define LOGIT_PRINT_FATAL_TO(index, ...) LOGIT_LOG_AND_RETURN_PRINT_WITH_INDEX(logit::LogLevel::LOG_LVL_FATAL, index, #__VA_ARGS__, __VA_ARGS__)
297#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__))
307#define LOGIT_TRACE_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, {}, #__VA_ARGS__, __VA_ARGS__)
308#define LOGIT_TRACE0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
309#define LOGIT_0TRACE_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
310#define LOGIT_0_TRACE_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
311#define LOGIT_NOARGS_TRACE_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, {})
312#define LOGIT_FORMAT_TRACE_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_TRACE, fmt, #__VA_ARGS__, __VA_ARGS__)
313#define LOGIT_PRINT_TRACE_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, fmt)
314#define LOGIT_PRINTF_TRACE_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_TRACE, logit::format(fmt, __VA_ARGS__))
317#define LOGIT_INFO_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, {}, #__VA_ARGS__, __VA_ARGS__)
318#define LOGIT_INFO0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
319#define LOGIT_0INFO_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
320#define LOGIT_0_INFO_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
321#define LOGIT_NOARGS_INFO_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, {})
322#define LOGIT_FORMAT_INFO_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_INFO, fmt, #__VA_ARGS__, __VA_ARGS__)
323#define LOGIT_PRINT_INFO_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, fmt)
324#define LOGIT_PRINTF_INFO_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_INFO, logit::format(fmt, __VA_ARGS__))
327#define LOGIT_DEBUG_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, {}, #__VA_ARGS__, __VA_ARGS__)
328#define LOGIT_DEBUG0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
329#define LOGIT_0DEBUG_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
330#define LOGIT_0_DEBUG_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
331#define LOGIT_NOARGS_DEBUG_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, {})
332#define LOGIT_FORMAT_DEBUG_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_DEBUG, fmt, #__VA_ARGS__, __VA_ARGS__)
333#define LOGIT_PRINT_DEBUG_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, fmt)
334#define LOGIT_PRINTF_DEBUG_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_DEBUG, logit::format(fmt, __VA_ARGS__))
337#define LOGIT_WARN_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, {}, #__VA_ARGS__, __VA_ARGS__)
338#define LOGIT_WARN0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
339#define LOGIT_0WARN_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
340#define LOGIT_0_WARN_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
341#define LOGIT_NOARGS_WARN_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, {})
342#define LOGIT_FORMAT_WARN_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_WARN, fmt, #__VA_ARGS__, __VA_ARGS__)
343#define LOGIT_PRINT_WARN_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, fmt)
344#define LOGIT_PRINTF_WARN_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_WARN, logit::format(fmt, __VA_ARGS__))
347#define LOGIT_ERROR_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, {}, #__VA_ARGS__, __VA_ARGS__)
348#define LOGIT_ERROR0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
349#define LOGIT_0ERROR_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
350#define LOGIT_0_ERROR_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
351#define LOGIT_NOARGS_ERROR_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, {})
352#define LOGIT_FORMAT_ERROR_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_ERROR, fmt, #__VA_ARGS__, __VA_ARGS__)
353#define LOGIT_PRINT_ERROR_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, fmt)
354#define LOGIT_PRINTF_ERROR_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_ERROR, logit::format(fmt, __VA_ARGS__))
357#define LOGIT_FATAL_IF(condition, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, {}, #__VA_ARGS__, __VA_ARGS__)
358#define LOGIT_FATAL0_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
359#define LOGIT_0FATAL_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
360#define LOGIT_0_FATAL_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
361#define LOGIT_NOARGS_FATAL_IF(condition) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, {})
362#define LOGIT_FORMAT_FATAL_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN(logit::LogLevel::LOG_LVL_FATAL, fmt, #__VA_ARGS__, __VA_ARGS__)
363#define LOGIT_PRINT_FATAL_IF(condition, fmt) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, fmt)
364#define LOGIT_PRINTF_FATAL_IF(condition, fmt, ...) if (condition) LOGIT_LOG_AND_RETURN_NOARGS(logit::LogLevel::LOG_LVL_FATAL, logit::format(fmt, __VA_ARGS__))
368#if defined(LOGIT_SHORT_NAME)
371#define LOG_T(...) LOGIT_TRACE(__VA_ARGS__)
372#define LOG_T0() LOGIT_TRACE0()
373#define LOG_0T() LOGIT_TRACE0()
374#define LOG_0_T() LOGIT_TRACE0()
375#define LOG_T_NOARGS() LOGIT_NOARGS_TRACE()
376#define LOG_NOARGS_T() LOGIT_NOARGS_TRACE()
377#define LOG_TF(fmt, ...) LOGIT_FORMAT_TRACE(fmt, __VA_ARGS__)
378#define LOG_FT(fmt, ...) LOGIT_FORMAT_TRACE(fmt, __VA_ARGS__)
379#define LOG_T_PRINT(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
380#define LOG_PRINT_T(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
381#define LOG_T_PRINTF(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
382#define LOG_PRINTF_T(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
383#define LOG_TP(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
384#define LOG_PT(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
385#define LOG_TPF(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
386#define LOG_PFT(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
388#define LOG_TRACE(...) LOGIT_TRACE(__VA_ARGS__)
389#define LOG_TRACE0() LOGIT_TRACE0()
390#define LOG_0TRACE() LOGIT_TRACE0()
391#define LOG_0_TRACE() LOGIT_TRACE0()
392#define LOG_TRACE_NOARGS() LOGIT_NOARGS_TRACE()
393#define LOG_NOARGS_TRACE() LOGIT_NOARGS_TRACE()
394#define LOG_TRACEF(fmt, ...) LOGIT_FORMAT_TRACE(fmt, __VA_ARGS__)
395#define LOG_FTRACE(fmt, ...) LOGIT_FORMAT_TRACE(fmt, __VA_ARGS__)
396#define LOG_TRACE_PRINT(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
397#define LOG_PRINT_TRACE(...) LOGIT_PRINT_TRACE(__VA_ARGS__)
398#define LOG_TRACE_PRINTF(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
399#define LOG_PRINTF_TRACE(fmt, ...) LOGIT_PRINTF_TRACE(fmt, __VA_ARGS__)
402#define LOG_I(...) LOGIT_INFO(__VA_ARGS__)
403#define LOG_I0() LOGIT_INFO0()
404#define LOG_0I() LOGIT_INFO0()
405#define LOG_0_I() LOGIT_INFO0()
406#define LOG_I_NOARGS() LOGIT_NOARGS_INFO()
407#define LOG_NOARGS_I() LOGIT_NOARGS_INFO()
408#define LOG_IF(fmt, ...) LOGIT_FORMAT_INFO(fmt, __VA_ARGS__)
409#define LOG_FI(fmt, ...) LOGIT_FORMAT_INFO(fmt, __VA_ARGS__)
410#define LOG_I_PRINT(...) LOGIT_PRINT_INFO(__VA_ARGS__)
411#define LOG_PRINT_I(...) LOGIT_PRINT_INFO(__VA_ARGS__)
412#define LOG_I_PRINTF(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
413#define LOG_PRINTF_I(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
414#define LOG_IP(...) LOGIT_PRINT_INFO(__VA_ARGS__)
415#define LOG_PI(...) LOGIT_PRINT_INFO(__VA_ARGS__)
416#define LOG_IPF(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
417#define LOG_PFI(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
419#define LOG_INFO(...) LOGIT_INFO(__VA_ARGS__)
420#define LOG_INFO0() LOGIT_INFO0()
421#define LOG_0INFO() LOGIT_INFO0()
422#define LOG_0_INFO() LOGIT_INFO0()
423#define LOG_INFO_NOARGS() LOGIT_NOARGS_INFO()
424#define LOG_NOARGS_INFO() LOGIT_NOARGS_INFO()
425#define LOG_INFOF(fmt, ...) LOGIT_FORMAT_INFO(fmt, __VA_ARGS__)
426#define LOG_FINFO(fmt, ...) LOGIT_FORMAT_INFO(fmt, __VA_ARGS__)
427#define LOG_INFO_PRINT(...) LOGIT_PRINT_INFO(__VA_ARGS__)
428#define LOG_PRINT_INFO(...) LOGIT_PRINT_INFO(__VA_ARGS__)
429#define LOG_INFO_PRINTF(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
430#define LOG_PRINTF_INFO(fmt, ...) LOGIT_PRINTF_INFO(fmt, __VA_ARGS__)
433#define LOG_D(...) LOGIT_DEBUG(__VA_ARGS__)
434#define LOG_D0() LOGIT_DEBUG0()
435#define LOG_0D() LOGIT_DEBUG0()
436#define LOG_0_D() LOGIT_DEBUG0()
437#define LOG_D_NOARGS() LOGIT_NOARGS_DEBUG()
438#define LOG_NOARGS_D() LOGIT_NOARGS_DEBUG()
439#define LOG_DF(fmt, ...) LOGIT_FORMAT_DEBUG(fmt, __VA_ARGS__)
440#define LOG_FD(fmt, ...) LOGIT_FORMAT_DEBUG(fmt, __VA_ARGS__)
441#define LOG_D_PRINT(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
442#define LOG_PRINT_D(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
443#define LOG_D_PRINTF(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
444#define LOG_PRINTF_D(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
445#define LOG_DP(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
446#define LOG_PD(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
447#define LOG_DPF(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
448#define LOG_PFD(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
450#define LOG_DEBUG(...) LOGIT_DEBUG(__VA_ARGS__)
451#define LOG_DEBUG0() LOGIT_DEBUG0()
452#define LOG_0DEBUG() LOGIT_DEBUG0()
453#define LOG_0_DEBUG() LOGIT_DEBUG0()
454#define LOG_DEBUG_NOARGS() LOGIT_NOARGS_DEBUG()
455#define LOG_NOARGS_DEBUG() LOGIT_NOARGS_DEBUG()
456#define LOG_DEBUGF(fmt, ...) LOGIT_FORMAT_DEBUG(fmt, __VA_ARGS__)
457#define LOG_FDEBUG(fmt, ...) LOGIT_FORMAT_DEBUG(fmt, __VA_ARGS__)
458#define LOG_DEBUG_PRINT(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
459#define LOG_PRINT_DEBUG(...) LOGIT_PRINT_DEBUG(__VA_ARGS__)
460#define LOG_DEBUG_PRINTF(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
461#define LOG_PRINTF_DEBUG(fmt, ...) LOGIT_PRINTF_DEBUG(fmt, __VA_ARGS__)
464#define LOG_W(...) LOGIT_WARN(__VA_ARGS__)
465#define LOG_W0() LOGIT_WARN0()
466#define LOG_0W() LOGIT_WARN0()
467#define LOG_0_W() LOGIT_WARN0()
468#define LOG_W_NOARGS() LOGIT_NOARGS_WARN()
469#define LOG_NOARGS_W() LOGIT_NOARGS_WARN()
470#define LOG_WF(fmt, ...) LOGIT_FORMAT_WARN(fmt, __VA_ARGS__)
471#define LOG_FW(fmt, ...) LOGIT_FORMAT_WARN(fmt, __VA_ARGS__)
472#define LOG_W_PRINT(...) LOGIT_PRINT_WARN(__VA_ARGS__)
473#define LOG_PRINT_W(...) LOGIT_PRINT_WARN(__VA_ARGS__)
474#define LOG_W_PRINTF(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
475#define LOG_PRINTF_W(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
476#define LOG_WP(...) LOGIT_PRINT_WARN(__VA_ARGS__)
477#define LOG_PW(...) LOGIT_PRINT_WARN(__VA_ARGS__)
478#define LOG_WPF(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
479#define LOG_PFW(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
481#define LOG_WARN(...) LOGIT_WARN(__VA_ARGS__)
482#define LOG_WARN0() LOGIT_WARN0()
483#define LOG_0WARN() LOGIT_WARN0()
484#define LOG_0_WARN() LOGIT_WARN0()
485#define LOG_WARN_NOARGS() LOGIT_NOARGS_WARN()
486#define LOG_NOARGS_WARN() LOGIT_NOARGS_WARN()
487#define LOG_WARNF(fmt, ...) LOGIT_FORMAT_WARN(fmt, __VA_ARGS__)
488#define LOG_FWARN(fmt, ...) LOGIT_FORMAT_WARN(fmt, __VA_ARGS__)
489#define LOG_WARN_PRINT(...) LOGIT_PRINT_WARN(__VA_ARGS__)
490#define LOG_PRINT_WARN(...) LOGIT_PRINT_WARN(__VA_ARGS__)
491#define LOG_WARN_PRINTF(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
492#define LOG_PRINTF_WARN(fmt, ...) LOGIT_PRINTF_WARN(fmt, __VA_ARGS__)
495#define LOG_E(...) LOGIT_ERROR(__VA_ARGS__)
496#define LOG_E0() LOGIT_ERROR0()
497#define LOG_0E() LOGIT_ERROR0()
498#define LOG_0_E() LOGIT_ERROR0()
499#define LOG_E_NOARGS() LOGIT_NOARGS_ERROR()
500#define LOG_NOARGS_E() LOGIT_NOARGS_ERROR()
501#define LOG_EF(fmt, ...) LOGIT_FORMAT_ERROR(fmt, __VA_ARGS__)
502#define LOG_FE(fmt, ...) LOGIT_FORMAT_ERROR(fmt, __VA_ARGS__)
503#define LOG_E_PRINT(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
504#define LOG_PRINT_E(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
505#define LOG_E_PRINTF(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
506#define LOG_PRINTF_E(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
507#define LOG_EP(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
508#define LOG_PE(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
509#define LOG_EPF(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
510#define LOG_PFE(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
512#define LOG_ERROR(...) LOGIT_ERROR(__VA_ARGS__)
513#define LOG_ERROR0() LOGIT_ERROR0()
514#define LOG_0ERROR() LOGIT_ERROR0()
515#define LOG_0_ERROR() LOGIT_ERROR0()
516#define LOG_ERROR_NOARGS() LOGIT_NOARGS_ERROR()
517#define LOG_NOARGS_ERROR() LOGIT_NOARGS_ERROR()
518#define LOG_ERRORF(fmt, ...) LOGIT_FORMAT_ERROR(fmt, __VA_ARGS__)
519#define LOG_FERROR(fmt, ...) LOGIT_FORMAT_ERROR(fmt, __VA_ARGS__)
520#define LOG_ERROR_PRINT(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
521#define LOG_PRINT_ERROR(...) LOGIT_PRINT_ERROR(__VA_ARGS__)
522#define LOG_ERROR_PRINTF(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
523#define LOG_PRINTF_ERROR(fmt, ...) LOGIT_PRINTF_ERROR(fmt, __VA_ARGS__)
526#define LOG_F(...) LOGIT_FATAL(__VA_ARGS__)
527#define LOG_F0() LOGIT_FATAL0()
528#define LOG_0F() LOGIT_FATAL0()
529#define LOG_0_F() LOGIT_FATAL0()
530#define LOG_F_NOARGS() LOGIT_NOARGS_FATAL()
531#define LOG_NOARGS_F() LOGIT_NOARGS_FATAL()
532#define LOG_FF(fmt, ...) LOGIT_FORMAT_FATAL(fmt, __VA_ARGS__)
533#define LOG_F_PRINT(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
534#define LOG_PRINT_F(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
535#define LOG_F_PRINTF(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
536#define LOG_PRINTF_F(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
537#define LOG_FP(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
538#define LOG_PF(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
539#define LOG_FPF(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
540#define LOG_PFF(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
542#define LOG_FATAL(...) LOGIT_FATAL(__VA_ARGS__)
543#define LOG_FATAL0() LOGIT_FATAL0()
544#define LOG_0FATAL() LOGIT_FATAL0()
545#define LOG_0_FATAL() LOGIT_FATAL0()
546#define LOG_FATAL_NOARGS() LOGIT_NOARGS_FATAL()
547#define LOG_NOARGS_FATAL() LOGIT_NOARGS_FATAL()
548#define LOG_FATALF(fmt, ...) LOGIT_FORMAT_FATAL(fmt, __VA_ARGS__)
549#define LOG_FFATAL(fmt, ...) LOGIT_FORMAT_FATAL(fmt, __VA_ARGS__)
550#define LOG_FATAL_PRINT(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
551#define LOG_PRINT_FATAL(...) LOGIT_PRINT_FATAL(__VA_ARGS__)
552#define LOG_FATAL_PRINTF(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
553#define LOG_PRINTF_FATAL(fmt, ...) LOGIT_PRINTF_FATAL(fmt, __VA_ARGS__)
563#if __cplusplus >= 201703L
571#define LOGIT_ADD_LOGGER(logger_type, logger_args, formatter_type, formatter_args) \
572 logit::Logger::get_instance().add_logger( \
573 std::make_unique<logger_type> logger_args, \
574 std::make_unique<formatter_type> formatter_args)
583#define LOGIT_ADD_LOGGER_SINGLE_MODE(logger_type, logger_args, formatter_type, formatter_args) \
584 logit::Logger::get_instance().add_logger( \
585 std::make_unique<logger_type> logger_args, \
586 std::make_unique<formatter_type> formatter_args, \
593#define LOGIT_ADD_CONSOLE(pattern, async) \
594 logit::Logger::get_instance().add_logger( \
595 std::make_unique<logit::ConsoleLogger>(async), \
596 std::make_unique<logit::SimpleLogFormatter>(pattern));
603#define LOGIT_ADD_CONSOLE_SINGLE_MODE(pattern, async) \
604 logit::Logger::get_instance().add_logger( \
605 std::make_unique<logit::ConsoleLogger>(async), \
606 std::make_unique<logit::SimpleLogFormatter>(pattern), \
612#define LOGIT_ADD_CONSOLE_DEFAULT() \
613 logit::Logger::get_instance().add_logger( \
614 std::make_unique<logit::ConsoleLogger>(true), \
615 std::make_unique<logit::SimpleLogFormatter>(LOGIT_CONSOLE_PATTERN));
620#define LOGIT_ADD_CONSOLE_DEFAULT_SINGLE_MODE() \
621 logit::Logger::get_instance().add_logger( \
622 std::make_unique<logit::ConsoleLogger>(true), \
623 std::make_unique<logit::SimpleLogFormatter>(LOGIT_CONSOLE_PATTERN), \
632#define LOGIT_ADD_FILE_LOGGER(directory, async, auto_delete_days, pattern) \
633 logit::Logger::get_instance().add_logger( \
634 std::make_unique<logit::FileLogger>( \
635 directory, async, auto_delete_days), \
636 std::make_unique<logit::SimpleLogFormatter>(pattern));
645#define LOGIT_ADD_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, pattern) \
646 logit::Logger::get_instance().add_logger( \
647 std::make_unique<logit::FileLogger>( \
648 directory, async, auto_delete_days), \
649 std::make_unique<logit::SimpleLogFormatter>(pattern), \
655#define LOGIT_ADD_FILE_LOGGER_DEFAULT() \
656 logit::Logger::get_instance().add_logger( \
657 std::make_unique<logit::FileLogger>( \
658 LOGIT_FILE_LOGGER_PATH, true, \
659 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS), \
660 std::make_unique<logit::SimpleLogFormatter>(LOGIT_FILE_LOGGER_PATTERN));
665#define LOGIT_ADD_FILE_LOGGER_DEFAULT_SINGLE_MODE() \
666 logit::Logger::get_instance().add_logger( \
667 std::make_unique<logit::FileLogger>( \
668 LOGIT_FILE_LOGGER_PATH, true, \
669 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS), \
670 std::make_unique<logit::SimpleLogFormatter>(LOGIT_FILE_LOGGER_PATTERN), \
680#define LOGIT_ADD_UNIQUE_FILE_LOGGER(directory, async, auto_delete_days, hash_length, pattern) \
681 logit::Logger::get_instance().add_logger( \
682 std::make_unique<logit::UniqueFileLogger>( \
683 directory, async, auto_delete_days, hash_length), \
684 std::make_unique<logit::SimpleLogFormatter>(pattern));
694#define LOGIT_ADD_UNIQUE_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, hash_length, pattern) \
695 logit::Logger::get_instance().add_logger( \
696 std::make_unique<logit::UniqueFileLogger>( \
697 directory, async, auto_delete_days, hash_length), \
698 std::make_unique<logit::SimpleLogFormatter>(pattern), \
706#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT() \
707 logit::Logger::get_instance().add_logger( \
708 std::make_unique<logit::UniqueFileLogger>( \
709 LOGIT_UNIQUE_FILE_LOGGER_PATH, true, \
710 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS), \
711 std::make_unique<logit::SimpleLogFormatter>(LOGIT_UNIQUE_FILE_LOGGER_PATTERN));
719#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT_SINGLE_MODE() \
720 logit::Logger::get_instance().add_logger( \
721 std::make_unique<logit::UniqueFileLogger>( \
722 LOGIT_UNIQUE_FILE_LOGGER_PATH, true, \
723 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS), \
724 std::make_unique<logit::SimpleLogFormatter>(LOGIT_UNIQUE_FILE_LOGGER_PATTERN), \
735#define LOGIT_ADD_LOGGER(logger_type, logger_args, formatter_type, formatter_args) \
736 logit::Logger::get_instance().add_logger( \
737 std::unique_ptr<logger_type>(new logger_type logger_args), \
738 std::unique_ptr<formatter_type>(new formatter_type formatter_args), \
748#define LOGIT_ADD_LOGGER_SINGLE_MODE(logger_type, logger_args, formatter_type, formatter_args) \
749 logit::Logger::get_instance().add_logger( \
750 std::unique_ptr<logger_type>(new logger_type logger_args), \
751 std::unique_ptr<formatter_type>(new formatter_type formatter_args), \
758#define LOGIT_ADD_CONSOLE(pattern, async) \
759 logit::Logger::get_instance().add_logger( \
760 std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(async)), \
761 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
769#define LOGIT_ADD_CONSOLE_SINGLE_MODE(pattern, async) \
770 logit::Logger::get_instance().add_logger( \
771 std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(async)), \
772 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
778#define LOGIT_ADD_CONSOLE_DEFAULT() \
779 logit::Logger::get_instance().add_logger( \
780 std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(true)), \
781 std::unique_ptr<logit::SimpleLogFormatter>( \
782 new logit::SimpleLogFormatter(LOGIT_CONSOLE_PATTERN)), \
788#define LOGIT_ADD_CONSOLE_DEFAULT_SINGLE_MODE() \
789 logit::Logger::get_instance().add_logger( \
790 std::unique_ptr<logit::ConsoleLogger>(new logit::ConsoleLogger(true)), \
791 std::unique_ptr<logit::SimpleLogFormatter>( \
792 new logit::SimpleLogFormatter(LOGIT_CONSOLE_PATTERN)), \
801#define LOGIT_ADD_FILE_LOGGER(directory, async, auto_delete_days, pattern) \
802 logit::Logger::get_instance().add_logger( \
803 std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
804 directory, async, auto_delete_days)), \
805 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)))
814#define LOGIT_ADD_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, pattern) \
815 logit::Logger::get_instance().add_logger( \
816 std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
817 directory, async, auto_delete_days)), \
818 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
824#define LOGIT_ADD_FILE_LOGGER_DEFAULT() \
825 logit::Logger::get_instance().add_logger( \
826 std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
827 LOGIT_FILE_LOGGER_PATH, true, \
828 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS)), \
829 std::unique_ptr<logit::SimpleLogFormatter>( \
830 new logit::SimpleLogFormatter(LOGIT_FILE_LOGGER_PATTERN)))
835#define LOGIT_ADD_FILE_LOGGER_DEFAULT_SINGLE_MODE() \
836 logit::Logger::get_instance().add_logger( \
837 std::unique_ptr<logit::FileLogger>(new logit::FileLogger( \
838 LOGIT_FILE_LOGGER_PATH, true, \
839 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS)), \
840 std::unique_ptr<logit::SimpleLogFormatter>( \
841 new logit::SimpleLogFormatter(LOGIT_FILE_LOGGER_PATTERN)), \
851#define LOGIT_ADD_UNIQUE_FILE_LOGGER(directory, async, auto_delete_days, hash_length, pattern) \
852 logit::Logger::get_instance().add_logger( \
853 std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
854 directory, async, auto_delete_days, hash_length)), \
855 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)))
865#define LOGIT_ADD_UNIQUE_FILE_LOGGER_SINGLE_MODE(directory, async, auto_delete_days, hash_length, pattern) \
866 logit::Logger::get_instance().add_logger( \
867 std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
868 directory, async, auto_delete_days, hash_length)), \
869 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(pattern)), \
877#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT() \
878 logit::Logger::get_instance().add_logger( \
879 std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
880 LOGIT_UNIQUE_FILE_LOGGER_PATH, true, \
881 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS)), \
882 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(LOGIT_UNIQUE_FILE_LOGGER_PATTERN)))
890#define LOGIT_ADD_UNIQUE_FILE_LOGGER_DEFAULT_SINGLE_MODE() \
891 logit::Logger::get_instance().add_logger( \
892 std::unique_ptr<logit::UniqueFileLogger>(new logit::UniqueFileLogger( \
893 LOGIT_UNIQUE_FILE_LOGGER_PATH, true, \
894 LOGIT_FILE_LOGGER_AUTO_DELETE_DAYS)), \
895 std::unique_ptr<logit::SimpleLogFormatter>(new logit::SimpleLogFormatter(LOGIT_UNIQUE_FILE_LOGGER_PATTERN)), \
908#define LOGIT_GET_STRING_PARAM(logger_index, param) \
909 logit::Logger::get_instance().get_string_param(logger_index, param)
915#define LOGIT_GET_INT_PARAM(logger_index, param) \
916 logit::Logger::get_instance().get_int_param(logger_index, param)
922#define LOGIT_GET_FLOAT_PARAM(logger_index, param) \
923 logit::Logger::get_instance().get_float_param(logger_index, param)
928#define LOGIT_GET_LAST_FILE_NAME(logger_index) \
929 logit::Logger::get_instance().get_string_param(logger_index, logit::LoggerParam::LastFileName)
934#define LOGIT_GET_LAST_FILE_PATH(logger_index) \
935 logit::Logger::get_instance().get_string_param(logger_index, logit::LoggerParam::LastFilePath)
940#define LOGIT_GET_LAST_LOG_TIMESTAMP(logger_index) \
941 logit::Logger::get_instance().get_int_param(logger_index, logit::LoggerParam::LastLogTimestamp)
946#define LOGIT_GET_TIME_SINCE_LAST_LOG(logger_index) \
947 logit::Logger::get_instance().get_float_param(logger_index, logit::LoggerParam::TimeSinceLastLog)
952#define LOGIT_SET_LOGGER_ENABLED(logger_index, enabled) \
953 logit::Logger::get_instance().set_logger_enabled(logger_index, enabled)
958#define LOGIT_IS_LOGGER_ENABLED(logger_index) \
959 logit::Logger::get_instance().is_logger_enabled(logger_index)
964#define LOGIT_SET_SINGLE_MODE(logger_index, single_mode) \
965 logit::Logger::get_instance().set_logger_single_mode(logger_index, single_mode)
970#define LOGIT_IS_SINGLE_MODE(logger_index) \
971 logit::Logger::get_instance().is_logger_single_mode(logger_index)
976#define LOGIT_WAIT() logit::Logger::get_instance().wait();