1fcft_log_init(3) fcft fcft_log_init(3)
2
3
4
6 fcft_log_init - configure logging in fcft
7
9 #include <fcft/fcft.h>
10
11 void fcft_log_init(
12 enum fcft_log_colorize colorize, bool do_syslog, enum
13 fcft_log_class log_level);
14
16 By default, fcft does not log anything; use fcft_log_init() to enable,
17 and configure logging in fcft.
18
19 fcft_log_init() is typically called early, at program startup.
20
21 colorize is one of:
22
23 enum fcft_log_colorize {
24 FCFT_LOG_COLORIZE_NEVER,
25 FCFT_LOG_COLORIZE_ALWAYS,
26 FCFT_LOG_COLORIZE_AUTO
27 };
28
29 FCFT_LOG_COLORIZE_AUTO enables colors if stderr is a TTY.
30
31 if do_syslog is set, fcft will log to syslog, in addition to the regu‐
32 lar logging on stderr.
33
34 Note that fcft does not call openlog(), even if do_syslog is set. Do
35 this from the calling application. Before, or after calling
36 fcft_log_init() does not matter, as long as it is done before calling
37 any other fcft API functions.
38
39 Finally, log_level configures which types of log messages that will be
40 shown.
41
42 enum fcft_log_class {
43 FCFT_LOG_CLASS_NONE,
44 FCFT_LOG_CLASS_ERROR,
45 FCFT_LOG_CLASS_WARNING,
46 FCFT_LOG_CLASS_INFO,
47 FCFT_LOG_CLASS_DEBUG
48 };
49
50 Note that this is not a bitmask; setting FCFT_LOG_CLASS_INFO, also en‐
51 ables FCFT_LOG_CLASS_WARNING and FCFT_LOG_CLASS_ERROR.
52
53
54
553.1.5 2022-09-20 fcft_log_init(3)