diff options
author | Anton Khirnov <anton@khirnov.net> | 2019-01-16 10:53:28 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2019-01-16 10:53:28 +0100 |
commit | d605be98a5ce957ed36a17182caec20e32132326 (patch) | |
tree | 0c852af465612684b5280144e06d4d8688115262 | |
parent | 3cf65cde6a94a3c6685ac1231472bf96fcea7b88 (diff) |
log: allow specifying a NULL callback to disable logging
-rw-r--r-- | log.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -34,6 +34,10 @@ void mg2di_log_default_callback(MG2DLogger *log, int level, void mg2di_log(MG2DLogger *log, int level, const char *fmt, ...) { va_list vl; + + if (!log->log) + return; + va_start(vl, fmt); log->log(log, level, fmt, vl); va_end(vl); |