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

Feature request: Add columns to dump_log object before write #7

Open
aecorn opened this issue May 4, 2021 · 1 comment
Open

Feature request: Add columns to dump_log object before write #7

aecorn opened this issue May 4, 2021 · 1 comment

Comments

@aecorn
Copy link

aecorn commented May 4, 2021

Use-case: Add username-column to log-rows to backtrack who made the changes.

Non-working solution, before dump_log():
transform( user = Sys.getenv("USERNAME")) %>>%
Results in all user-add-edits being logged, instead of username being added to existing rows in logs.

Better, but verbose solution:
After dump, read file back in, add column, write out again.

log_cellwise <- read.csv("log_cellwise.csv")
log_cellwise <- transform(log_cellwise, user = Sys.getenv("USERNAME"))
write.csv(log_cellwise, "log_cellwise.csv")

Are there some "Arguments passed to the dump method of the logger." that can be passed to achieve adding a column before the dump?
I would love if something like this was possible:
dump_log(data, "cellwise", file ="log.csv", cols = single_value/expression/transform() )
But I can see how it would open a can of worms potentially. Maybe there is some smart set of parameters / methods I am unaware of that could fit?

@markvanderloo
Copy link
Owner

Thank you for the feedback. This seems a useful feature in a multi-user environment. I will take a look if something like a user id, and/or machine name can be added somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants