restored the lost code for 'J' in fmt.c
This commit is contained in:
parent
e6be071a54
commit
bfba16a757
23
lib/fmt.c
23
lib/fmt.c
@ -880,6 +880,17 @@ static int fmt_outv (hcl_fmtout_t* fmtout, va_list ap)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'J':
|
||||||
|
{
|
||||||
|
hcl_bitmask_t tmp;
|
||||||
|
if (!fmtout->putobj) goto invalid_format;
|
||||||
|
tmp = fmtout->mask;
|
||||||
|
fmtout->mask |= HCL_LOG_PREFER_JSON;
|
||||||
|
if (fmtout->putobj(fmtout, va_arg(ap, hcl_oop_t)) <= -1) goto oops;
|
||||||
|
fmtout->mask = tmp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
case 'e':
|
case 'e':
|
||||||
case 'E':
|
case 'E':
|
||||||
@ -2467,6 +2478,18 @@ static HCL_INLINE int format_stack_args (hcl_fmtout_t* fmtout, hcl_ooi_t nargs,
|
|||||||
if (fmtout->putobj(fmtout, arg) <= -1) goto oops;
|
if (fmtout->putobj(fmtout, arg) <= -1) goto oops;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'J':
|
||||||
|
{
|
||||||
|
hcl_bitmask_t tmp;
|
||||||
|
GET_NEXT_ARG_TO (hcl, nargs, &arg_state, arg);
|
||||||
|
tmp = fmtout->mask;
|
||||||
|
fmtout->mask |= HCL_LOG_PREFER_JSON;
|
||||||
|
if (fmtout->putobj(fmtout, arg) <= -1) goto oops;
|
||||||
|
fmtout->mask = tmp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
print_integer:
|
print_integer:
|
||||||
{
|
{
|
||||||
const hcl_ooch_t* nsptr;
|
const hcl_ooch_t* nsptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user