Add sanity checks to output plugins / Add config option FLOG_CONFIG_MSG_ID_STRINGS_EX...
[flog.git] / flog_output_stdio.h
blob7f5efb1fc75d67688d4e31a3196b8ede05a91d71
1 //! stdio output for Flog
3 //! @file flog_output_stdio.h
4 //! @author Nabeel Sowan (nabeel.sowan@vibes.se)
5 //!
6 //! When you want flog to write to stdout or stderr
9 #ifndef FLOG_OUTPUT_STDIO_H
10 #define FLOG_OUTPUT_STDIO_H
12 #include "flog.h"
14 #ifdef FLOG_CONFIG_OUTPUT_STDIO
16 // Sanity checks
17 #ifndef FLOG_CONFIG_STRING_OUTPUT
18 #error FLOG_CONFIG_OUTPUT_STDIO requires FLOG_CONFIG_STRING_OUTPUT
19 #endif
20 #ifndef FLOG_CONFIG_MSG_ID_STRINGS
21 #error FLOG_CONFIG_OUTPUT_STDIO requires FLOG_CONFIG_MSG_ID_STRINGS
22 #endif
23 #ifndef FLOG_CONFIG_ERRNO_STRINGS
24 #error FLOG_CONFIG_OUTPUT_STDIO requires FLOG_CONFIG_ERRNO_STRINGS
25 #endif
27 int flog_output_stdout(FLOG_T *log,const FLOG_MSG_T *msg);
28 int flog_output_stderr(FLOG_T *log,const FLOG_MSG_T *msg);
30 FLOG_T * create_flog_output_stdout(const char *name, FLOG_MSG_TYPE_T accepted_msg_type);
31 FLOG_T * create_flog_output_stderr(const char *name, FLOG_MSG_TYPE_T accepted_msg_type);
33 #endif //FLOG_CONFIG_OUTPUT_STDIO
35 #endif //FLOG_OUTPUT_STDIO_H