From 37acb9a97cd3ff034f529b78739f93707877855c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 16 Jan 2019 11:12:56 +0100 Subject: mg2d: add a context variable to control the log level Simpler to use than overriding the log callback. API bump. --- mg2d.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'mg2d.h') diff --git a/mg2d.h b/mg2d.h index 834e717..a587a18 100644 --- a/mg2d.h +++ b/mg2d.h @@ -168,7 +168,9 @@ typedef struct MG2DContext { /** * A callback that will be used to print diagnostic messages. * - * Defaults to fprintf(stderr, ...) + * The default implementation prints to stderr. + * + * May be set to NULL to disable logging. */ void (*log_callback)(const struct MG2DContext *ctx, int level, const char *fmt, va_list); @@ -272,6 +274,12 @@ typedef struct MG2DContext { * Time-stepping factor to use for relaxation. */ double cfl_factor; + + /** + * Maximum level of messages printed by the default logging callback. Has no + * effect when log_callback is overridden. + */ + enum MG2DLogLevel log_level; } MG2DContext; /** -- cgit v1.2.3