From 0017564a69399dda8408c129e033beae46cdac33 Mon Sep 17 00:00:00 2001 From: "hyunghwan.chung" Date: Mon, 28 Jan 2019 17:42:04 +0000 Subject: [PATCH] set the default log type if not set --- moo/lib/fmtout.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/moo/lib/fmtout.c b/moo/lib/fmtout.c index 8b6ef52..39a2562 100644 --- a/moo/lib/fmtout.c +++ b/moo/lib/fmtout.c @@ -670,6 +670,12 @@ moo_ooi_t moo_logbfmt (moo_t* moo, moo_bitmask_t mask, const moo_bch_t* fmt, ... * it'll get turned back on */ mask |= (moo->log.default_type_mask & MOO_LOG_ALL_TYPES); } + else if (!(mask & MOO_LOG_ALL_TYPES)) + { + /* no type is set in the given mask and no default type is set. + * make it UNTYPED. */ + mask |= MOO_LOG_UNTYPED; + } fo.mask = mask; fo.putch = put_ooch; @@ -698,6 +704,10 @@ moo_ooi_t moo_logufmt (moo_t* moo, moo_bitmask_t mask, const moo_uch_t* fmt, ... mask &= ~MOO_LOG_UNTYPED; mask |= (moo->log.default_type_mask & MOO_LOG_ALL_TYPES); } + else if (!(mask & MOO_LOG_ALL_TYPES)) + { + mask |= MOO_LOG_UNTYPED; + } fo.mask = mask; fo.putch = put_ooch;