aboutsummaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2022-01-31 21:38:04 +0100
committerToni Uhlig <matzeton@googlemail.com>2022-02-03 03:48:37 +0100
commitf9e4c5885423c6f5b3d8b46c1c872b9e9330b054 (patch)
treefe389e98a15e9e5c7751a106905037df419107c5 /utils.h
parent1a0d7ddbfaccc20e081a2fcd0a27495c166e1dbe (diff)
Added logging interface used by nDPId, nDPIsrvd and nDPId-test.
* fixed GitLab pipeline * nDPId: added static assert (just for a test) * nDPId: memory profiling for total bytes compressed * nDPId-test: enable zLib compression if configured with ENABLE_ZLIB Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/utils.h b/utils.h
index 12bc9d373..2db510067 100644
--- a/utils.h
+++ b/utils.h
@@ -1,20 +1,44 @@
#ifndef UTILS_H
#define UTILS_H 1
-int is_path_absolute(char const * const prefix,
- char const * const path);
+#include <stdarg.h>
+
+int is_path_absolute(char const * const prefix, char const * const path);
void daemonize_enable(void);
+int is_daemonize_enabled(void);
+
int daemonize_with_pidfile(char const * const pidfile);
int daemonize_shutdown(char const * const pidfile);
-int change_user_group(char const * const user, char const * const group,
+int change_user_group(char const * const user,
+ char const * const group,
char const * const pidfile,
char const * const uds_collector_path,
char const * const uds_distributor_path);
-char const * get_nDPId_version();
+void init_logging(char const * const daemon_name);
+
+void log_app_info(void);
+
+void shutdown_logging(void);
+
+int enable_file_logger(char const * const log_file);
+
+int get_log_file_fd(void);
+
+void enable_console_logger(void);
+
+int is_console_logger_enabled(void);
+
+void vlogger(int is_error, char const * const format, va_list ap);
+
+__attribute__((format(printf, 2, 3))) void logger(int is_error, char const * const format, ...);
+
+__attribute__((format(printf, 2, 3))) void logger_early(int is_error, char const * const format, ...);
+
+char const * get_nDPId_version(void);
#endif