Skip to content

Commit

Permalink
Merge pull request #130 from Rapporteket/bugfix-sanitize-log
Browse files Browse the repository at this point in the history
Bugfix sanitize log
  • Loading branch information
areedv authored Sep 19, 2022
2 parents d933e57 + 5c40908 commit d110118
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 5 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rapbase
Type: Package
Title: Base Functions and Resources for Rapporteket
Version: 1.23.0
Version: 1.23.1
Authors@R: c(
person(given = "Are",
family = "Edvardsen",
Expand Down Expand Up @@ -45,7 +45,7 @@ Imports:
sship (>= 0.8.0),
utils,
yaml
RoxygenNote: 7.1.2
RoxygenNote: 7.2.1
URL: https://github.com/Rapporteket/rapbase
BugReports: https://github.com/Rapporteket/rapbase/issues
Suggests:
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export(repLogger)
export(runAutoReport)
export(runBulletin)
export(runNoweb)
export(sanitizeLog)
export(saveStagingData)
export(selectListPubkey)
export(sendEmail)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# rapbase 1.23.1

* Fixed Fixed bug in log sanitizer function ([#130](https://github.com/Rapporteket/rapbase/pull/130))

# rapbase 1.23.0

* Reduced number of imports by replacing local function with functions from [sship](https://github.com/Rapporteket/sship) ([#127](https://github.com/Rapporteket/rapbase/pull/127))
Expand Down
11 changes: 9 additions & 2 deletions R/log.R
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ readLog <- function(type, name = "") {
#' Sanitize log entries that have reached end of life
#'
#' @return NULL on success
#' @keywords internal
#' @export
sanitizeLog <- function() {
conf <- getConfig(fileName = "rapbaseConfig.yml")

Expand All @@ -431,7 +431,14 @@ sanitizeLog <- function() {
if (backupOk) {
lf <- lf %>%
dplyr::filter(as.Date(.data$time) > eolDate)
write.table(lf, logFile[i], append = FALSE, col.names = TRUE, sep = ",")
write.table(
lf,
logFile[i],
append = FALSE,
sep = ",",
row.names = FALSE,
col.names = TRUE,
qmethod = "double")
}
}
}
Expand Down
1 change: 1 addition & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ reference:
Handle logging
contents:
- logger
- sanitizeLog

- title: Automated reports
desc: >
Expand Down
1 change: 0 additions & 1 deletion man/sanitizeLog.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d110118

Please sign in to comment.