c_util
C utility library for low-level programming
Loading...
Searching...
No Matches
message.h
Go to the documentation of this file.
1
11#pragma once
12
31
37#define ENABLE_MESSAGE_SEVERITY_ERROR 1
38
44#define ENABLE_MESSAGE_SEVERITY_WARNING 1
45
46#ifdef RELEASE_BUILD
51 #define ENABLE_MESSAGE_SEVERITY_INFORMATION 0
52
57 #define ENABLE_MESSAGE_SEVERITY_DEBUG 0
58#else
63 #define ENABLE_MESSAGE_SEVERITY_INFORMATION 1
64
69 #define ENABLE_MESSAGE_SEVERITY_DEBUG 1
70#endif
71
79void message_output(MESSAGE_SEVERITY severity_, const char* const fmt_, ...);
80
81#if ENABLE_MESSAGE_SEVERITY_ERROR
86 #define ERROR_MESSAGE(...) message_output(MESSAGE_SEVERITY_ERROR, __VA_ARGS__)
87#else
92 #define ERROR_MESSAGE(...)
93#endif
94
95#if ENABLE_MESSAGE_SEVERITY_WARNING
100 #define WARN_MESSAGE(...) message_output(MESSAGE_SEVERITY_WARNING, __VA_ARGS__)
101#else
106 #define WARN_MESSAGE(...)
107#endif
108
109#if ENABLE_MESSAGE_SEVERITY_INFORMATION
114 #define INFO_MESSAGE(...) message_output(MESSAGE_SEVERITY_INFORMATION, __VA_ARGS__)
115#else
120 #define INFO_MESSAGE(...)
121#endif
122
123#if ENABLE_MESSAGE_SEVERITY_DEBUG
128 #define DEBUG_MESSAGE(...) message_output(MESSAGE_SEVERITY_DEBUG, __VA_ARGS__)
129#else
134 #define DEBUG_MESSAGE(...)
135#endif
void message_output(MESSAGE_SEVERITY severity_, const char *const fmt_,...)
メッセージ出力関数(メッセージの重要度に応じて出力フォーマットを変える)
Definition message.c:24
MESSAGE_SEVERITY
出力メッセージ重要度リスト
Definition message.h:18
@ MESSAGE_SEVERITY_ERROR
重要度:エラー
Definition message.h:20
@ MESSAGE_SEVERITY_DEBUG
重要度:デバッグ情報
Definition message.h:29
@ MESSAGE_SEVERITY_INFORMATION
重要度:情報
Definition message.h:26
@ MESSAGE_SEVERITY_WARNING
重要度:ワーニング
Definition message.h:23