Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline messages will be destroyed #18

Open
sigbertklinke opened this issue Mar 19, 2022 · 2 comments
Open

Multiline messages will be destroyed #18

sigbertklinke opened this issue Mar 19, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@sigbertklinke
Copy link

msg <- paste0("Package: smvgraph %s", utils::packageVersion("smvgraph"), "\n(C) 2022- Sigbert Klinke, HU Berlin")
loggit("DEBUG", msg, echo=FALSE)

leads in the loggit file to

{"timestamp": "2022-03-19T18:51:36+0100", "log_lvl": "DEBUG", "log_msg": "Package: smvgraph %s0.2.0__LF__(C) 2022- Sigbert Klinke__COMMA__ HU Berlin"}

But reading the log into R produces

read_logs()
                 timestamp log_lvl log_msg
1 2022-03-19T18:51:36+0100   DEBUG Package
@ryapric
Copy link
Owner

ryapric commented Mar 20, 2022

Thanks! Can you please post your sessionInfo() output, including the version of loggit being used?

If this is reproducible, I'll get to work on a fix -- but that fix might end up being a new major version (3.x) depending on the changes.

I would, however, bring your attention to the release notes for v2.0.0, and ask if you're correctly seeing this warning when your message has a newline?

@ryapric ryapric added the enhancement New feature or request label Mar 20, 2022
@ryapric
Copy link
Owner

ryapric commented Mar 20, 2022

Oh, it's not the multiline, it's your colon after Package:

msg <- paste0("Package smvgraph %s", utils::packageVersion("smvgraph"), "\n(C) 2022- Sigbert Klinke, HU Berlin")
loggit("DEBUG", msg, echo=FALSE)
read_logs()
                 timestamp log_lvl log_msg
1 2022-03-19T18:51:36+0100   DEBUG Package smvgraph %s0.2.0\n(C) 2022- Sigbert Klinke, HU Berlin

Please confirm that you see the same. If so, that's an easy fix to the default sanitizer and preparser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants