@@ -34,70 +34,71 @@ namespace erpc {
34
34
#define ERPC_LOG_DEFAULT_STREAM stdout
35
35
36
36
// Log messages with "reorder" or higher verbosity get written to
37
- // trace_file_or_default_stream . This can be stdout for basic debugging, or
37
+ // erpc_trace_file_or_default_stream . This can be stdout for basic debugging, or
38
38
// eRPC's trace file for more involved debugging.
39
39
40
- #define trace_file_or_default_stream trace_file
41
- // #define trace_file_or_default_stream ERPC_LOG_DEFAULT_STREAM
40
+ #define erpc_trace_file_or_default_stream trace_file
41
+ // #define erpc_trace_file_or_default_stream ERPC_LOG_DEFAULT_STREAM
42
42
43
43
// If ERPC_LOG_LEVEL is not defined, default to the highest level so that
44
44
// YouCompleteMe does not report compilation errors
45
45
#ifndef ERPC_LOG_LEVEL
46
46
#define ERPC_LOG_LEVEL ERPC_LOG_LEVEL_CC
47
47
#endif
48
48
49
- static void output_log_header (int level);
50
-
51
49
#if ERPC_LOG_LEVEL >= ERPC_LOG_LEVEL_ERROR
52
- #define ERPC_ERROR (...) \
53
- output_log_header (ERPC_LOG_DEFAULT_STREAM, ERPC_LOG_LEVEL_ERROR); \
54
- fprintf (ERPC_LOG_DEFAULT_STREAM, __VA_ARGS__); \
50
+ #define ERPC_ERROR (...) \
51
+ erpc_output_log_header (ERPC_LOG_DEFAULT_STREAM, ERPC_LOG_LEVEL_ERROR); \
52
+ fprintf (ERPC_LOG_DEFAULT_STREAM, __VA_ARGS__); \
55
53
fflush (ERPC_LOG_DEFAULT_STREAM)
56
54
#else
57
55
#define ERPC_ERROR (...) ((void )0 )
58
56
#endif
59
57
60
58
#if ERPC_LOG_LEVEL >= ERPC_LOG_LEVEL_WARN
61
- #define ERPC_WARN (...) \
62
- output_log_header (ERPC_LOG_DEFAULT_STREAM, ERPC_LOG_LEVEL_WARN); \
63
- fprintf (ERPC_LOG_DEFAULT_STREAM, __VA_ARGS__); \
59
+ #define ERPC_WARN (...) \
60
+ erpc_output_log_header (ERPC_LOG_DEFAULT_STREAM, ERPC_LOG_LEVEL_WARN); \
61
+ fprintf (ERPC_LOG_DEFAULT_STREAM, __VA_ARGS__); \
64
62
fflush (ERPC_LOG_DEFAULT_STREAM)
65
63
#else
66
64
#define ERPC_WARN (...) ((void )0 )
67
65
#endif
68
66
69
67
#if ERPC_LOG_LEVEL >= ERPC_LOG_LEVEL_INFO
70
- #define ERPC_INFO (...) \
71
- output_log_header (ERPC_LOG_DEFAULT_STREAM, ERPC_LOG_LEVEL_INFO); \
72
- fprintf (ERPC_LOG_DEFAULT_STREAM, __VA_ARGS__); \
68
+ #define ERPC_INFO (...) \
69
+ erpc_output_log_header (ERPC_LOG_DEFAULT_STREAM, ERPC_LOG_LEVEL_INFO); \
70
+ fprintf (ERPC_LOG_DEFAULT_STREAM, __VA_ARGS__); \
73
71
fflush (ERPC_LOG_DEFAULT_STREAM)
74
72
#else
75
73
#define ERPC_INFO (...) ((void )0 )
76
74
#endif
77
75
78
76
#if ERPC_LOG_LEVEL >= ERPC_LOG_LEVEL_REORDER
79
- #define ERPC_REORDER (...) \
80
- output_log_header (trace_file_or_default_stream, ERPC_LOG_LEVEL_REORDER); \
81
- fprintf (trace_file_or_default_stream, __VA_ARGS__); \
82
- fflush (trace_file_or_default_stream)
77
+ #define ERPC_REORDER (...) \
78
+ erpc_output_log_header (erpc_trace_file_or_default_stream, \
79
+ ERPC_LOG_LEVEL_REORDER); \
80
+ fprintf (erpc_trace_file_or_default_stream, __VA_ARGS__); \
81
+ fflush (erpc_trace_file_or_default_stream)
83
82
#else
84
83
#define ERPC_REORDER (...) ((void )0 )
85
84
#endif
86
85
87
86
#if ERPC_LOG_LEVEL >= ERPC_LOG_LEVEL_TRACE
88
- #define ERPC_TRACE (...) \
89
- output_log_header (trace_file_or_default_stream, ERPC_LOG_LEVEL_TRACE); \
90
- fprintf (trace_file_or_default_stream, __VA_ARGS__); \
91
- fflush (trace_file_or_default_stream)
87
+ #define ERPC_TRACE (...) \
88
+ erpc_output_log_header (erpc_trace_file_or_default_stream, \
89
+ ERPC_LOG_LEVEL_TRACE); \
90
+ fprintf (erpc_trace_file_or_default_stream, __VA_ARGS__); \
91
+ fflush (erpc_trace_file_or_default_stream)
92
92
#else
93
93
#define ERPC_TRACE (...) ((void )0 )
94
94
#endif
95
95
96
96
#if ERPC_LOG_LEVEL >= ERPC_LOG_LEVEL_CC
97
- #define ERPC_CC (...) \
98
- output_log_header (trace_file_or_default_stream, ERPC_LOG_LEVEL_CC); \
99
- fprintf (trace_file_or_default_stream, __VA_ARGS__); \
100
- fflush (trace_file_or_default_stream)
97
+ #define ERPC_CC (...) \
98
+ erpc_output_log_header (erpc_trace_file_or_default_stream, \
99
+ ERPC_LOG_LEVEL_CC); \
100
+ fprintf (erpc_trace_file_or_default_stream, __VA_ARGS__); \
101
+ fflush (erpc_trace_file_or_default_stream)
101
102
#else
102
103
#define ERPC_CC (...) ((void )0 )
103
104
#endif
@@ -115,7 +116,7 @@ static std::string get_formatted_time() {
115
116
}
116
117
117
118
// Output log message header
118
- static void output_log_header (FILE *stream, int level) {
119
+ static void erpc_output_log_header (FILE *stream, int level) {
119
120
std::string formatted_time = get_formatted_time ();
120
121
121
122
const char *type;
0 commit comments