| ImportLog | R Documentation |
Generate log data and manage recording timings for an import
Generate log data and manage recording timings for an import
Class to help help manage initialising log data, managing recording time for log to run and importing row to the log table.
log_dataThe current log data
new()Build the data to be written to the import log
Create import log instance for managing creating log data and importing to db.
Initialises log data and verifies that import can be logged. Set
a comment for the log using set_comment
ImportLog$new(con, log_table, path, language, mode)
conConnection to db to add log record to
log_tableName of the import log table
pathPath to import being run
languageThe language for the import, R or sql.
languageThe language for the import, R or sql
modeThe mode of the import, only relevant for an R import.
modeThe mode of the import, only relevant for an R import
import_pathPath to the import process directory.
The prepared data for the log table. This is the name of the import, the date, comment and git information including user name, user email, current branch and hash of HEAD.
set_comment()Set the comment on the log data
ImportLog$set_comment(comment)
commentThe comment to be stored with this import.
start_timer()Start the import log timer
ImportLog$start_timer()
stop_timer()Stop the import log timer, adding duration to the total recorded duration.
ImportLog$stop_timer()
write_log()Write the log data to the database.
ImportLog$write_log()
verify_first_run()Verify that this is the first time the import has been run.
Check whether an import with the same name has been run already. If so then stop with a human understandable message.
ImportLog$verify_first_run()
Throws an error if an import with the same name has already been run
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.