Generate log layout function using common variables available via glue syntax
Source:R/layouts.R
layout_glue_generator.Rd
format
is passed to glue
with access to the below variables:
msg: the actual log message
further variables set by
get_logger_meta_variables()
Value
function taking level
and msg
arguments - keeping the
original call creating the generator in the generator
attribute
that is returned when calling log_layout()
for the currently
used layout
See also
See example calls from layout_glue()
and layout_glue_colors()
.
Other log_layouts:
get_logger_meta_variables()
,
layout_blank()
,
layout_glue()
,
layout_glue_colors()
,
layout_json()
,
layout_json_parser()
,
layout_logging()
,
layout_simple()
Examples
example_layout <- layout_glue_generator(
format = "{node}/{pid}/{ns}/{ans}/{topenv}/{fn} {time} {level}: {msg}"
)
example_layout(INFO, "try {runif(1)}")
#> fv-az1198-739/8176/NA/global/R_GlobalEnv/eval 2024-10-21 07:31:17.159736 INFO: try {runif(1)}
log_layout(example_layout)
log_info("try {runif(1)}")
#> fv-az1198-739/8176/global/global/R_GlobalEnv/eval 2024-10-21 07:31:17.162369 INFO: try 0.0807501375675201