From 6cdec68b01b0c8aac14b34f55ecd9d6b8e9e374b Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 28 Jan 2019 13:51:27 +0000 Subject: [PATCH] set UNTYPED if no type is given in hcl_logbfmtv() and hcl_logufmtv() --- lib/logfmt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/logfmt.c b/lib/logfmt.c index 1dc6526..4400761 100644 --- a/lib/logfmt.c +++ b/lib/logfmt.c @@ -421,6 +421,12 @@ hcl_ooi_t hcl_logbfmtv (hcl_t* hcl, hcl_bitmask_t mask, const hcl_bch_t* fmt, va * it'll get turned back on */ mask |= (hcl->log.default_type_mask & HCL_LOG_ALL_TYPES); } + else if (!(mask & HCL_LOG_ALL_TYPES)) + { + /* no type is set in the given mask and no default type is set. + * make it UNTYPED. */ + mask |= HCL_LOG_UNTYPED; + } fo.mask = mask; fo.putch = put_logch; @@ -458,6 +464,10 @@ hcl_ooi_t hcl_logufmtv (hcl_t* hcl, hcl_bitmask_t mask, const hcl_uch_t* fmt, va mask &= ~HCL_LOG_UNTYPED; mask |= (hcl->log.default_type_mask & HCL_LOG_ALL_TYPES); } + else if (!(mask & HCL_LOG_ALL_TYPES)) + { + mask |= HCL_LOG_UNTYPED; + } fo.mask = mask; fo.putch = put_logch;