diff options
author | Anton Khirnov <anton@khirnov.net> | 2019-01-16 11:12:56 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2019-01-16 11:13:50 +0100 |
commit | 37acb9a97cd3ff034f529b78739f93707877855c (patch) | |
tree | 29c49ec9de3ffbdd0de742fc3bcb00ae720d701f /mg2d.h | |
parent | d605be98a5ce957ed36a17182caec20e32132326 (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.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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; /** |