daroczig / logger

A lightweight, modern and flexible, log4j and futile.logger inspired logging utility for R
https://daroczig.github.io/logger
280 stars 41 forks source link

log_separator is not working properly for other layouts than layout_simple #95

Closed Polkas closed 2 years ago

Polkas commented 2 years ago

Example where the static 23 characters for log header will not work correctly. This 23 characters comes from layout_simple which is assumed to be always used now.

logger <- layout_glue_generator(format = '{node}/{pid}/{namespace}/{fn} {time} {level}: {msg}')
log_layout(logger)
log_separator(ERROR, separator = '!', width = 80)

I already working on that and will add solution to my PR. This is exposed on log_with_separator too. I will pin this issue to my PR.

BTW If it should not be supported then roxygen2 docs should be straight forward (that width have to be adjusted for custom layouts).

daroczig commented 2 years ago

Thanks for the report and the related fix :bow: