diff options
Diffstat (limited to 'src/log.h')
-rw-r--r-- | src/log.h | 29 |
1 files changed, 9 insertions, 20 deletions
@@ -5,12 +5,12 @@ #define JALV_LOG_H #include "attributes.h" -#include "types.h" #include "urids.h" -#include "lv2/log/log.h" -#include "lv2/urid/urid.h" +#include <lv2/log/log.h> +#include <lv2/urid/urid.h> +#include <stdarg.h> #include <stdbool.h> #include <stdio.h> @@ -20,11 +20,8 @@ # define JALV_LOG_FUNC(fmt, arg1) #endif -JALV_BEGIN_DECLS - -struct Port; - // String and log utilities +JALV_BEGIN_DECLS typedef enum { JALV_LOG_ERR = 3, @@ -38,34 +35,26 @@ typedef struct { bool tracing; } JalvLog; -void -jalv_print_control(Jalv* jalv, const struct Port* port, float value); - -char* -jalv_strdup(const char* str); - -char* -jalv_strjoin(const char* a, const char* b); - -JALV_LOG_FUNC(2, 0) -int -jalv_vlog(JalvLogLevel level, const char* fmt, va_list ap); - +/// Print a log message to stderr with a GCC-like prefix and color JALV_LOG_FUNC(2, 3) int jalv_log(JalvLogLevel level, const char* fmt, ...); +/// LV2 log vprintf function JALV_LOG_FUNC(3, 0) int jalv_vprintf(LV2_Log_Handle handle, LV2_URID type, const char* fmt, va_list ap); +/// LV2 log printf function JALV_LOG_FUNC(3, 4) int jalv_printf(LV2_Log_Handle handle, LV2_URID type, const char* fmt, ...); +/// Write an ANSI escape sequence to set the foreground color bool jalv_ansi_start(FILE* stream, int color); +/// Write an ANSI escape sequence to reset the foreground color void jalv_ansi_reset(FILE* stream); |