ryapric / loggit

Modern Logging for the R Ecosystem
Other
37 stars 2 forks source link

Warnings if log_msg has more than one attribute #2

Closed denrou closed 6 years ago

denrou commented 6 years ago

First of all, thank you for this package!

Now, for the problem I encounter:

library(loggit)
library(glue)

loggit("INFO", "First message")
loggit("INFO", "Second message")
# Warning message:
# In bind_rows_(x, .id) :
#   Vectorizing 'glue' elements may not preserve their attributes

This warning pops up because of bind_rows because glue::glue gives an object of class glue which is not present in the column of the dataframe.

I see two solutions to overcome this:

Note that I expect this kind of warning to happen not just with glue but for all objects with other attributes than character (dates, durations, ...)

ryapric commented 6 years ago

Hi Denis, thanks for pointing that out. I'd much rather take the first option, as the latter would suppress all warnings, which is a little spooky.

I have added your suggestion to the latest Github version, v1.1.1. Documentation also now clearly states that those two fields will be coerced to character entries.

Thanks!