| logMessage | R Documentation |
The message is written to the logFile and displayed in the console, if
logFile does not exist the message is only displayed in the console.
cli formatting is preserved in the console and removed from the text file.
logMessage(
message = "Start logging file",
logFile = getOption("omopgenerics.logFile")
)
message |
Message to log. cli expressions in braces are evaluated in the calling environment. |
logFile |
File path to write logging messages. Create a logFile with
|
Invisible TRUE if the logging message is written to a log file.
library(dplyr)
logFile <- tempfile(pattern = "log_{date}_{time}", fileext = ".txt")
createLogFile(logFile = logFile)
logMessage("Starting analysis")
1 + 1
logMessage("Analysis finished")
x <- c("a", "b", "c")
for (i in seq_along(x)) {
logMessage("{x[i]}")
}
res <- summariseLogFile()
glimpse(res)
tidy(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.