aboutsummaryrefslogtreecommitdiff
path: root/mg2d.h
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-01-16 11:12:56 +0100
committerAnton Khirnov <anton@khirnov.net>2019-01-16 11:13:50 +0100
commit37acb9a97cd3ff034f529b78739f93707877855c (patch)
tree29c49ec9de3ffbdd0de742fc3bcb00ae720d701f /mg2d.h
parentd605be98a5ce957ed36a17182caec20e32132326 (diff)
mg2d: add a context variable to control the log level
Simpler to use than overriding the log callback. API bump.
Diffstat (limited to 'mg2d.h')
-rw-r--r--mg2d.h10
1 files changed, 9 insertions, 1 deletions
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;
/**