added HCL_LOG_PREFER_JSON and implemented %J

This commit is contained in:
2018-03-02 07:44:13 +00:00
parent 83a0d3ea37
commit 15453eb0f7
5 changed files with 107 additions and 54 deletions

View File

@ -95,7 +95,7 @@ static struct
};
enum
enum
{
FLAGC_DOT = (1 << 0),
FLAGC_SPACE = (1 << 1),
@ -1002,6 +1002,11 @@ static HCL_INLINE int print_formatted (hcl_t* hcl, hcl_ooi_t nargs, hcl_fmtout_t
if (hcl_outfmtobj(hcl, data->mask, arg, outbfmt) <= -1) goto oops;
break;
case 'J':
GET_NEXT_ARG_TO (hcl, nargs, &arg_state, arg);
if (hcl_outfmtobj(hcl, data->mask | HCL_LOG_PREFER_JSON, arg, outbfmt) <= -1) goto oops;
break;
number:
{
const hcl_ooch_t* nsptr;