layout_json_parser: Generate log layout function rendering JSON after merging...

Description Usage Arguments Note See Also Examples

View source: R/layouts.R

Description

Generate log layout function rendering JSON after merging meta fields with parsed list from JSON message

Usage

1
2
3
layout_json_parser(fields = c("time", "level", "ns", "ans", "topenv",
  "fn", "node", "arch", "os_name", "os_release", "os_version", "pid",
  "user"))

Arguments

fields

character vector of field names to be included in the JSON

Note

This functionality depends on the jsonlite package.

See Also

This is a log_layout potentially to be used with formatter_json, for alternatives, see layout_simple, layout_glue, layout_glue_colors, layout_json or generator functions such as layout_glue_generator

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
log_formatter(formatter_json)
log_info(everything = 42)
log_layout(layout_json_parser())
log_info(everything = 42)
log_layout(layout_json_parser(fields = c('time', 'node')))
log_info(cars = row.names(mtcars), species = unique(iris$Species))

## End(Not run)

daroczig/logger documentation built on Dec. 6, 2019, 6:17 a.m.