Add sanity checks to output plugins / Add config option FLOG_CONFIG_MSG_ID_STRINGS_EX...
[flog.git] / config.h
blobfdaac878fb7199ce46efa2254aa8fa073a210034
1 //! Config file for Flog
3 //! @file config.h
4 //! @author Nabeel Sowan (nabeel.sowan@vibes.se)
5 //!
6 //! Set these defines according to the needs of your project.
9 //! @def FLOG_CONFIG_ALLOW_NULL_MESSAGES
10 //! If defined, then messages with msg_id=0 and a NULL text string will
11 //! be passed on as valid flog messages.
12 #define FLOG_CONFIG_ALLOW_NULL_MESSAGES
15 //! @def FLOG_CONFIG_MSG_TYPE_ENUM_API
16 //! If defined, allows using an enum API for flog message types.
17 //! What this means is that FLOG_MSG_TYPE_T will be defined as an int
18 //! (instead of unsigned char) In return, enums may yield stronger
19 //! type checking and therefore easier debugging.
20 #define FLOG_CONFIG_MSG_TYPE_ENUM_API
23 //! @def FLOG_CONFIG_RECURSIVE_MAX_STACK_DEPTH
24 //! If defined, this option is used by the recursive functions flog_add_msg()
25 //! and flog_is_message_used(). It specifies the maximum stack depth they
26 //! are allowed to reach and thereby indirectly setting a limit on the
27 //! stack usage of flog. Usually each stack level allocates a FLOG_T struct
28 //! and a couple of arguments. To avoid infinite recursion caused by circular
29 //! sublog structures, set this to a sane value like 8-32.
30 #define FLOG_CONFIG_RECURSIVE_MAX_STACK_DEPTH 16
33 //! @def FLOG_CONFIG_ABORT_ON_ASSERT
34 //! If defined then flog_assert() will call abort() on assertion failure.
35 //! This behaviour can be switched off for deeply embedded systems where
36 //! calling abort() doesn't make any sense.
37 #define FLOG_CONFIG_ABORT_ON_ASSERT
40 //! @def FLOG_CONFIG_TIMESTAMP
41 //! If defined, then this activates timestamping of flog messages,
42 //! using time.h. This requires working time routines in libc.
43 #define FLOG_CONFIG_TIMESTAMP
46 //! @def FLOG_CONFIG_TIMESTAMP_USEC
47 //! If defined, then this activates timestamping of flog messages with
48 //! millisecond (usec) accuracy. Requires sys/time.h support.
49 #define FLOG_CONFIG_TIMESTAMP_USEC
52 //! @def FLOG_CONFIG_SRC_INFO
53 //! If defined, then each flog message will contain information about the
54 //! specific file, line and function name where flog_print(f) was called.
55 #define FLOG_CONFIG_SRC_INFO
58 //! @def FLOG_CONFIG_STRING_OUTPUT
59 //! If defined, then string output routines will be included in the
60 //! flog_string module. Omitting this will save a few k by avoiding
61 //! some code from stdio etc. Useful for cases where a deeply embedded
62 //! system should only transmit flog messages in binary form over a network.
63 #define FLOG_CONFIG_STRING_OUTPUT
66 //! @def FLOG_CONFIG_MSG_ID_STRINGS
67 //! If defined, then the FLOG_MSG_ID string data will be included.
68 //! This can be omitted for deeply embedded systems where string generation
69 //! isn't strictly necessary, and can be decoded by the receiver.
70 #define FLOG_CONFIG_MSG_ID_STRINGS
73 //! @def FLOG_CONFIG_MSG_ID_STRINGS_EXTENDED
74 //! If defined, a couple of useful message strings will be included in flog.
75 //! Undefine this to save a little bit of memory.
76 #define FLOG_CONFIG_MSG_ID_STRINGS_EXTENDED
79 //! @def FLOG_CONFIG_ERRNO_STRINGS
80 //! If defined, then setting msg_id to a valid libc errno will fetch the
81 //! correct string from libc when outputing a string.
82 #define FLOG_CONFIG_ERRNO_STRINGS
85 //! @def FLOG_CONFIG_OUTPUT_SHOW_MSG_ID
86 //! If defined, then output of msg_id messages will print the msg_id
87 //! number (be it errno or a flog msg id)
88 #define FLOG_CONFIG_OUTPUT_SHOW_MSG_ID
91 //! @def FLOG_CONFIG_OUTPUT_STDIO
92 //! If defined, then flog will include the stdio output module (stdout and stderr)
93 #define FLOG_CONFIG_OUTPUT_STDIO
96 //! @def FLOG_CONFIG_OUTPUT_FILE
97 //! If defined, then flog will include the simple file output module.
98 #define FLOG_CONFIG_OUTPUT_FILE