Skip to content

Commit

Permalink
Move execution logging to capture any error messages in logs
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonysena committed Jan 16, 2025
1 parent c425fa4 commit 1f1fb7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
22 changes: 11 additions & 11 deletions R/Execution.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ execute <- function(analysisSpecifications,
}
}

# Set up logging
if (!dir.exists(dirname(executionSettings$logFileName))) {
dir.create(dirname(executionSettings$logFileName), recursive = T)
}
ParallelLogger::addDefaultFileLogger(
name = "STRATEGUS_LOGGER",
fileName = executionSettings$logFileName
)
on.exit(ParallelLogger::unregisterLogger("STRATEGUS_LOGGER"))


# Determine if the user has opted to subset to specific modules
# in the analysis specification. If so, validate that the
# modulesToExecute are present in the analysis specification
Expand Down Expand Up @@ -134,17 +145,6 @@ execute <- function(analysisSpecifications,
analysisSpecifications$moduleSpecifications <- analysisSpecifications$moduleSpecifications[moduleSubset]
}


# Set up logging
if (!dir.exists(dirname(executionSettings$logFileName))) {
dir.create(dirname(executionSettings$logFileName), recursive = T)
}
ParallelLogger::addDefaultFileLogger(
name = "STRATEGUS_LOGGER",
fileName = executionSettings$logFileName
)
on.exit(ParallelLogger::unregisterLogger("STRATEGUS_LOGGER"))

if (is(executionSettings, "CdmExecutionSettings")) {
cdmDatabaseMetaData <- getCdmDatabaseMetaData(
cdmExecutionSettings = executionSettings,
Expand Down
1 change: 1 addition & 0 deletions Strategus.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 33476d3f-e097-4954-a223-a348664c34b9

RestoreWorkspace: No
SaveWorkspace: No
Expand Down

0 comments on commit 1f1fb7b

Please sign in to comment.