Go to the documentation of this file.
24 #ifndef __NNSTREAMER_LOG_H__
25 #define __NNSTREAMER_LOG_H__
28 #define TAG_NAME "nnstreamer"
30 #if defined(__TIZEN__)
37 #include "../../tests/unittest_util.h"
40 #define ml_logi(...) \
41 dlog_print (DLOG_INFO, TAG_NAME, __VA_ARGS__)
43 #define ml_logw(...) \
44 dlog_print (DLOG_WARN, TAG_NAME, __VA_ARGS__)
46 #define ml_loge(...) \
47 dlog_print (DLOG_ERROR, TAG_NAME, __VA_ARGS__)
49 #define ml_logd(...) \
50 dlog_print (DLOG_DEBUG, TAG_NAME, __VA_ARGS__)
52 #define ml_logf(...) \
53 dlog_print (DLOG_FATAL, TAG_NAME, __VA_ARGS__)
55 #elif defined(__ANDROID__)
56 #include <android/log.h>
58 #define ml_logi(...) \
59 __android_log_print (ANDROID_LOG_INFO, TAG_NAME, __VA_ARGS__)
61 #define ml_logw(...) \
62 __android_log_print (ANDROID_LOG_WARN, TAG_NAME, __VA_ARGS__)
64 #define ml_loge(...) \
65 __android_log_print (ANDROID_LOG_ERROR, TAG_NAME, __VA_ARGS__)
67 #define ml_logd(...) \
68 __android_log_print (ANDROID_LOG_DEBUG, TAG_NAME, __VA_ARGS__)
70 #define ml_logf(...) \
71 __android_log_print (ANDROID_LOG_FATAL, TAG_NAME, __VA_ARGS__)
76 #define ml_logi g_info
77 #define ml_logw g_warning
78 #define ml_loge g_critical
79 #define ml_logd g_debug
80 #define ml_logf g_error
94 #define GST_ELEMENT_ERROR_BTRACE(s, errtype, errcode, mesg) do { \
95 char *btrace = _backtrace_to_string (); \
97 GST_ELEMENT_ERROR (s, errtype, errcode, mesg, ("%s", btrace)); \
102 #define ml_logf_stacktrace(...) do { \
103 char *btrace = _backtrace_to_string (); \
105 ml_loge ("%s\n", btrace); \
108 ml_logf (__VA_ARGS__); \
111 #define ml_log_stacktrace(logfunc, ...) do { \
112 char *btrace = _backtrace_to_string (); \
114 logfunc ("%s\n", btrace); \
117 logfunc (__VA_ARGS__); \
119 #define ml_loge_stacktrace(...) ml_log_stacktrace(ml_loge, __VA_ARGS__)
140 #define nns_logi ml_logi
141 #define nns_logw ml_logw
142 #define nns_loge ml_loge
143 #define nns_logd ml_logd
144 #define nns_logf ml_logf
char * _backtrace_to_string(void)
stack trace as a string for error messages
void _nnstreamer_error_clean(void)
cleans up the error message buffer.
const char * _nnstreamer_error(void)
return the last internal error string and clean it.
void _nnstreamer_error_write(const char *fmt,...)
overwrites the error message buffer with the new message.