You.i Engine
YiLoggerHelper.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2017. All rights reserved.
2 #ifndef _YI_LOGGER_HELPER_H_
3 #define _YI_LOGGER_HELPER_H_
4 
6 
18 void YiLog(const char *pModuleName,
19  const char *pPrettyFunction,
20  uint32_t unLineNumber,
21  const CYIString &rTagName,
22  YI_LOG_SEVERITY eSeverity,
23  const char *pMessage,
24  ...);
25 
26 void YiLog(const char *pModuleName,
27  const char *pPrettyFunction,
28  uint32_t unLineNumber,
29  const std::string &rTagName,
30  YI_LOG_SEVERITY eSeverity,
31  const char *pMessage,
32  ...);
33 
34 void YiLog(const char *pModuleName,
35  const char *pPrettyFunction,
36  uint32_t unLineNumber,
37  const char *pTagName,
38  YI_LOG_SEVERITY eSeverity,
39  const char *pMessage,
40  ...);
41 
46 #if defined(YI_PS4)
47 # include <libdbg.h>
48 # define YI_LOGF(tag, msg, ...) do { YI_LOG_CHECK_PARAMETERS(tag, msg, ##__VA_ARGS__) YiLog(YI_TRACE_INFO, (tag), YI_LOG_FATAL, YI_ENSURE_STRING_LITERAL(msg), ##__VA_ARGS__); SCE_BREAK(); } while (0)
49 #elif defined(YI_UWP) || defined(YI_WIN32)
50 # define YI_LOGF(tag, msg, ...) \
51  __pragma(warning(push)) \
52  __pragma(warning(disable:4127)) \
53  do \
54  { \
55  YI_LOG_CHECK_PARAMETERS(tag, msg, ##__VA_ARGS__) \
56  YiLog(YI_TRACE_INFO, (tag), YI_LOG_FATAL, YI_ENSURE_STRING_LITERAL(msg), ##__VA_ARGS__); abort(); \
57  } \
58  while ((void)0, 0) \
59  __pragma(warning(pop))
60 #else
61 # define YI_LOGF(tag, msg, ...) do { YI_LOG_CHECK_PARAMETERS(tag, msg, ##__VA_ARGS__) YiLog(YI_TRACE_INFO, (tag), YI_LOG_FATAL, YI_ENSURE_STRING_LITERAL(msg), ##__VA_ARGS__); abort(); } while (0)
62 #endif
63 
67 #define YI_LOGE(tag, msg, ...) do { YI_LOG_CHECK_PARAMETERS(tag, msg, ##__VA_ARGS__) YiLog(YI_TRACE_INFO, (tag), YI_LOG_ERROR, YI_ENSURE_STRING_LITERAL(msg), ##__VA_ARGS__); } while (0)
68 
72 #define YI_LOGW(tag, msg, ...) do { YI_LOG_CHECK_PARAMETERS(tag, msg, ##__VA_ARGS__) YiLog(YI_TRACE_INFO, (tag), YI_LOG_WARNING, YI_ENSURE_STRING_LITERAL(msg), ##__VA_ARGS__); } while (0)
73 
76 #define YI_LOGI(tag, msg, ...) do { YI_LOG_CHECK_PARAMETERS(tag, msg, ##__VA_ARGS__) YiLog(YI_TRACE_INFO, (tag), YI_LOG_INFO, YI_ENSURE_STRING_LITERAL(msg), ##__VA_ARGS__); } while (0)
77 
80 #define YI_LOGD(tag, msg, ...) do { YI_LOG_CHECK_PARAMETERS(tag, msg, ##__VA_ARGS__) YiLog(YI_TRACE_INFO, (tag), YI_LOG_DEBUG, YI_ENSURE_STRING_LITERAL(msg), ##__VA_ARGS__); } while (0)
81 
86 #endif /* _YI_LOGGER_HELPER_H_ */
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:35
YI_LOG_SEVERITY
Enumeration for the severity levels.
Definition: YiLoggerCommon.h:51
void YiLog(const char *pModuleName, const char *pPrettyFunction, uint32_t unLineNumber, const CYIString &rTagName, YI_LOG_SEVERITY eSeverity, const char *pMessage,...)