diff --git a/OperationalCS.R b/OperationalCS.R index 1d79b4ff48cd51135ff949063e1d0ef352078721..2f034dbc6a4cbf4a504304d3f6abf5df6e14b796 100644 --- a/OperationalCS.R +++ b/OperationalCS.R @@ -19,11 +19,13 @@ source("tools/libs.R") # Create output folder and log: logger <- prepare_outputs(recipe = recipe, file = args[2], conf = conf) - +log_file <- logger$logname +logger <- logger$logger # Checks: check_conf(conf, file = args[1], logger) verifications <- check_recipe(recipe, file = args[2], conf, logger) # Go to verification code: -source("modules/verifications.R") +capture.output(source("modules/verifications.R"), file = log_file, type ='message', + append = TRUE) diff --git a/modules/verifications.R b/modules/verifications.R index 2749201a888c6b0d9d12a9432d6f685cf1e3217e..8078762c57963c0b248b31d8ae1d2367354a4184 100644 --- a/modules/verifications.R +++ b/modules/verifications.R @@ -4,7 +4,7 @@ print(indep) info(logger, paste(" #*****************************************#", " # Starting Independent verification of Indicator ", - " indep[[1]]$name", + indep, sep = "\n")) ind_table <- read_yaml(paste0(conf$code_dir, "conf/indicators_table.yml")) @@ -15,7 +15,7 @@ print(indep) info(logger, paste(" #*****************************************#", " # Starting Independent verification of ECV ", - " indep[[1]]$name, indep[[1]]$freq", + paste(indep, collapse = ' '), sep = "\n")) variable <- indep$name store.freq <- indep$freq diff --git a/recipes/conf_user.yml b/recipes/conf_user.yml index 490da5e25486b063e4aad9107caa6f4d1da8c654..c394d368088c9675730504795eb634f0e15778a9 100644 --- a/recipes/conf_user.yml +++ b/recipes/conf_user.yml @@ -2,3 +2,4 @@ output_dir: /esarchive/scratch/nperez/git/auto-s2s/out-logs/ code_dir: /esarchive/scratch/nperez/git/auto-s2s/ + diff --git a/tools/prepare_outputs.R b/tools/prepare_outputs.R index 08f0063e00e6602ce6489c0e0909f27eccd8284a..192956588f41bc4cb36bc0503c4382edbc898b7b 100644 --- a/tools/prepare_outputs.R +++ b/tools/prepare_outputs.R @@ -30,5 +30,5 @@ prepare_outputs <- function(recipe, file, conf) { appenders = list(file_appender(logfile, append = TRUE, layout = default_log_layout()))) } - return(logger) + return(list(logger = logger, logname = logfile)) }