From 2bee6573df99b41dae478b6890f7b5278fd2608d Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Mon, 12 Sep 2022 15:03:28 +0200 Subject: [PATCH 1/5] do NOT write rownames! --- R/log.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/R/log.R b/R/log.R index 4f106b85..d9598dfc 100644 --- a/R/log.R +++ b/R/log.R @@ -431,7 +431,13 @@ 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) } } } From 1c1b9817ccca5aa37109dc4f362eafa09ea01af6 Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Tue, 13 Sep 2022 11:58:15 +0200 Subject: [PATCH 2/5] stranger lineend things --- R/log.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/log.R b/R/log.R index d9598dfc..6cf02935 100644 --- a/R/log.R +++ b/R/log.R @@ -437,7 +437,8 @@ sanitizeLog <- function() { append = FALSE, sep = ",", row.names = FALSE, - col.names = TRUE) + col.names = TRUE, + qmethod = "double") } } } From 73b9193d75fbf5718ff97dfaf9fa6d259671c828 Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Thu, 15 Sep 2022 14:35:34 +0200 Subject: [PATCH 3/5] sanitizeLog not internal fun anymore --- DESCRIPTION | 2 +- NAMESPACE | 1 + R/log.R | 2 +- man/sanitizeLog.Rd | 1 - 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f592fb0c..8d357b43 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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: diff --git a/NAMESPACE b/NAMESPACE index 823bf246..c07afb87 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -67,6 +67,7 @@ export(repLogger) export(runAutoReport) export(runBulletin) export(runNoweb) +export(sanitizeLog) export(saveStagingData) export(selectListPubkey) export(sendEmail) diff --git a/R/log.R b/R/log.R index 6cf02935..1f06b066 100644 --- a/R/log.R +++ b/R/log.R @@ -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") diff --git a/man/sanitizeLog.Rd b/man/sanitizeLog.Rd index 023b78de..966be87f 100644 --- a/man/sanitizeLog.Rd +++ b/man/sanitizeLog.Rd @@ -12,4 +12,3 @@ NULL on success \description{ Sanitize log entries that have reached end of life } -\keyword{internal} From 28c0bb63bef40b52b3fea1ac94d3d4f739d9c1af Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Mon, 19 Sep 2022 09:16:38 +0200 Subject: [PATCH 4/5] update site docs --- _pkgdown.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_pkgdown.yml b/_pkgdown.yml index adc1f5fc..4613ffd6 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -50,6 +50,7 @@ reference: Handle logging contents: - logger + - sanitizeLog - title: Automated reports desc: > From 5c409081af3eff32c24dbf5f6ace623cd20851f6 Mon Sep 17 00:00:00 2001 From: Are Edvardsen Date: Mon, 19 Sep 2022 09:20:53 +0200 Subject: [PATCH 5/5] upping --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 8d357b43..0e55678e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -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", diff --git a/NEWS.md b/NEWS.md index 5e2ff097..adcc922c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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))