I’ve just released ParallelLogger v1.2.0, which has a new feature that might be of interest for those creating study packages: You can now create an error report logger. This will create a report file whenever a fatal error occurs during execution. (the user will be notified: “An error report has been created at …”) It will even log errors within sub-threads. This report is intended to be shared with the package developer to help debug. Here’s an example report:
Message: Error in DatabaseConnector::connect(connectionDetails) : object ‘connectionDetails’ not found
Time: 2020-04-22 07:07:27
3: CreateAllCohorts.R#50: DatabaseConnector::connect(connectionDetails)
2: Main.R#82: createCohorts(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, cohortDatabaseSchema = cohortDatabaseSchema, cohortTable =
1: execute(connectionDetails = connectionDetails, cdmDatabaseSchema = cdmDatabaseSchema, cohortDatabaseSchema = cohortDatabaseSchema, cohortTable = cohortTable, orac
R version 3.6.1 (2019-07-05)
Attached base packages:
Other attached packages:
- Covid19Il6JakInhibitorsSccs (0.0.1)
- DatabaseConnector (3.0.0)
Here’s an example where I include the logger in a study package.
The new version is available on GitHub and has been accepted for CRAN, so should appear there shortly.
(Also note that the names of the default loggers have changed. For example, the default file logger is no longer called ‘DEFAULT’ but ‘DEFAULT_FILE_LOGGER’, so to unregister you should use