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

@ -588,6 +588,10 @@ static int logfmtv (hcl_t* hcl, const fmtchar_t* fmt, hcl_fmtout_t* data, va_lis
if (hcl_outfmtobj(hcl, data->mask, va_arg(ap, hcl_oop_t), outbfmt) <= -1) goto oops;
break;
case 'J':
if (hcl_outfmtobj(hcl, data->mask | HCL_LOG_PREFER_JSON, va_arg(ap, hcl_oop_t), outbfmt) <= -1) goto oops;
break;
#if 0
case 'e':
case 'E':