set UNTYPED if no type is given in hcl_logbfmtv() and hcl_logufmtv()

This commit is contained in:
hyung-hwan 2019-01-28 13:51:27 +00:00
parent 1fa0d684bc
commit 6cdec68b01

View File

@ -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 */ * it'll get turned back on */
mask |= (hcl->log.default_type_mask & HCL_LOG_ALL_TYPES); 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.mask = mask;
fo.putch = put_logch; 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_UNTYPED;
mask |= (hcl->log.default_type_mask & HCL_LOG_ALL_TYPES); 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.mask = mask;
fo.putch = put_logch; fo.putch = put_logch;