From 87f165ac89990a89198f256e1794e14d2d07dae3 Mon Sep 17 00:00:00 2001 From: Gediminas Jakutis Date: Thu, 3 Oct 2019 10:22:20 +0300 Subject: diagnostic: allow setting output stream(s). Added a function to allow changing a channel's output stream. This also makes it possible to direct output to a file. Signed-off-by: Gediminas Jakutis --- include/rin/diagnostic.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/rin') diff --git a/include/rin/diagnostic.h b/include/rin/diagnostic.h index 64b44ef..f60008d 100644 --- a/include/rin/diagnostic.h +++ b/include/rin/diagnostic.h @@ -21,6 +21,8 @@ #ifndef LIBRIN_DIAGNOSTIC_INCLUDED #define LIBRIN_DIAGNOSTIC_INCLUDED +#include + #define RIN_DIAG_SET 1 #define RIN_DIAG_UNSET 0 #define RIN_DIAG_PREFIX (1 << 0) @@ -30,7 +32,15 @@ RIN_DIAG_TIME | \ RIN_DIAG_THREADNUM) +enum rin_diag_outstream { + rin_diag_err, + rin_diag_warn, + rin_diag_fixme, + rin_diag_info +}; + int rin_diag_flags(int flag, int action); +int rin_diag_set_outstream(enum rin_diag_outstream channel, FILE *stream); void rin_err(const char *format, ...); void rin_fixme(const char *format, ...); -- cgit v1.2.3