Code

error utils: Make the logger callback configurable.
[sysdb.git] / src / include / utils / error.h
index aaa288c33c3e51f2e12bbaa8252196ee51480d0a..e170a7d5e85109406a15af21d4247daa27cd0083 100644 (file)
@@ -66,6 +66,15 @@ enum {
                : ((prio) == SDB_LOG_INFO) ? "INFO" \
                : ((prio) == SDB_LOG_DEBUG) ? "DEBUG" : "UNKNOWN")
 
+/*
+ * sdb_error_set_logger:
+ * Set the logging callback to be used for logging messages. By default (or
+ * when explicitely setting the logger to NULL), logs will be written to the
+ * stderr channel.
+ */
+void
+sdb_error_set_logger(int (*f)(int, const char *));
+
 /*
  * sdb_log:
  * Log the specified message. The string will be formatted in printf-style