summaryrefslogtreecommitdiffstats
path: root/inc
diff options
context:
space:
mode:
authorManuel Bentele2020-10-20 15:31:52 +0200
committerManuel Bentele2020-10-20 15:31:52 +0200
commit85c3fe47292f4e4e47a1f58f1347cb1f6d03b37e (patch)
treed8d7cf3d229bec1ec0b94747b5f427fd6bd6f063 /inc
parent[BUILD] do not stop Release build if repository is dirty but warn (diff)
downloaddnbd3-85c3fe47292f4e4e47a1f58f1347cb1f6d03b37e.tar.gz
dnbd3-85c3fe47292f4e4e47a1f58f1347cb1f6d03b37e.tar.xz
dnbd3-85c3fe47292f4e4e47a1f58f1347cb1f6d03b37e.zip
[BUILD] add option to build the dnbd3-server with afl-fuzz support
The afl-fuzz support for the dnbd3-server requires an AFL C compiler like afl-gcc and can be enabled with the CMake option DNBD3_SERVER_AFL.
Diffstat (limited to 'inc')
-rw-r--r--inc/dnbd3/shared/log.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/inc/dnbd3/shared/log.h b/inc/dnbd3/shared/log.h
index 5b1e8f7..9185b18 100644
--- a/inc/dnbd3/shared/log.h
+++ b/inc/dnbd3/shared/log.h
@@ -23,6 +23,7 @@
#include <stdbool.h>
#include <unistd.h>
+#include <stdio.h>
typedef unsigned int logmask_t;
#define LOG_ERROR ((logmask_t)1) // Fatal error, server will terminate
@@ -32,6 +33,10 @@ typedef unsigned int logmask_t;
#define LOG_DEBUG1 ((logmask_t)16) // Debug information, use this for non-spammy stuff
#define LOG_DEBUG2 ((logmask_t)32) // Use this for debug messages that will show up a lot
+/**
+ * Initialize the logging (constructor)
+ */
+void log_init(void);
/**
* Check if cansoleMask | fileMask has all of mask set.
@@ -45,6 +50,16 @@ void log_setConsoleMask(logmask_t mask);
void log_setConsoleTimestamps(bool on);
/**
+ * Set console output stream
+ * The output stream can be either stdout or stderr
+ *
+ * Note: A call of this function is optional and only required if the output
+ * stream should be changed from stdout to stderr since the log
+ * implementation defaults to the output stream stdout
+ */
+int log_setConsoleOutputStream(FILE *outputStream);
+
+/**
* Open or reopen the log file. If path is NULL and the
* function was called with a path before, the same path
* will be used again.