-
Notifications
You must be signed in to change notification settings - Fork 2
Implement automatic log rotation #21
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
base: main
Are you sure you want to change the base?
Conversation
This can happen when rotate_lines > nrow(log_df) Signed-off-by: Peter Solymos <psolymos@gmail.com>
Signed-off-by: Peter Solymos <psolymos@gmail.com>
Signed-off-by: Peter Solymos <psolymos@gmail.com>
Signed-off-by: Peter Solymos <psolymos@gmail.com>
Signed-off-by: Peter Solymos <psolymos@gmail.com>
R/configurations.R
Outdated
| #' set_rotate_lines(NULL) # turn off auto-truncation | ||
| #' | ||
| #' @export | ||
| set_rotate_lines <- function(rotate_lines = 100000, confirm = TRUE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think given the naming convention of the function itself (set_rotate_lines() vs. e.g. set_rotation_on()), this should default to NULL instead of an integer, since it expects an integer. Might need a check in rotate_logs() as well if NULL is passed in, so it doesn't crash.
|
Thank you, looks pretty good! Could you also add some tests to confirm functionality? |
|
@ryapric I addressed the comments. Let me know what you think. |
This PR addresses #20 and fixes an issue when
nrow(log_df) - rotate_lines + 1leads to negative row index.