Generate log layout function rendering JSON
See also
Other log_layouts:
get_logger_meta_variables()
,
layout_blank()
,
layout_glue()
,
layout_glue_colors()
,
layout_glue_generator()
,
layout_json_parser()
,
layout_logging()
,
layout_simple()
Examples
log_layout(layout_json())
log_info(42)
#> {"time":"2025-01-28 13:49:28","level":"INFO","ns":"global","ans":"global","topenv":"R_GlobalEnv","fn":"eval","node":"fv-az1370-267","arch":"x86_64","os_name":"Linux","os_release":"6.8.0-1020-azure","os_version":"#23-Ubuntu SMP Mon Dec 9 16:58:58 UTC 2024","pid":9760,"user":"runner","msg":"42"}
log_info("ok {1:3} + {1:3} = {2*(1:3)}")
#> {"time":"2025-01-28 13:49:28","level":"INFO","ns":"global","ans":"global","topenv":"R_GlobalEnv","fn":"eval","node":"fv-az1370-267","arch":"x86_64","os_name":"Linux","os_release":"6.8.0-1020-azure","os_version":"#23-Ubuntu SMP Mon Dec 9 16:58:58 UTC 2024","pid":9760,"user":"runner","msg":"ok 1 + 1 = 2"}
#> {"time":"2025-01-28 13:49:28","level":"INFO","ns":"global","ans":"global","topenv":"R_GlobalEnv","fn":"eval","node":"fv-az1370-267","arch":"x86_64","os_name":"Linux","os_release":"6.8.0-1020-azure","os_version":"#23-Ubuntu SMP Mon Dec 9 16:58:58 UTC 2024","pid":9760,"user":"runner","msg":"ok 2 + 2 = 4"}
#> {"time":"2025-01-28 13:49:28","level":"INFO","ns":"global","ans":"global","topenv":"R_GlobalEnv","fn":"eval","node":"fv-az1370-267","arch":"x86_64","os_name":"Linux","os_release":"6.8.0-1020-azure","os_version":"#23-Ubuntu SMP Mon Dec 9 16:58:58 UTC 2024","pid":9760,"user":"runner","msg":"ok 3 + 3 = 6"}