Launch the log viewer Shiny app
launchLogViewer(logFileName)
Name of the log file to view.
Launches a Shiny app that allows the user to view a log file created using the default file logger.
Use addDefaultFileLogger
to start the default file logger.
# Create a log file:
logFile <- file.path(tempdir(), "log.txt")
addDefaultFileLogger(logFile)
logInfo("Hello world")
#> 2024-08-23 08:25:54 Hello world
# Launch the log file viewer (only if in interactive mode):
if (interactive()) {
launchLogViewer(logFile)
}
# Delete the log file:
unlink(logFile)