Install the package from this github repository.
library(devtools) install_github("ayayron/logviewr") # After successful installation library(logviewr)
After the successful installation, you'll want to restart your RStudio session and after that you will see the log viewer in the Add-ins dropdown.
Let's set up a basic logger and create a log message:
library(log4r) # Logger object "logger" will be created and write to # the file logfile.log in the current working directory logger = create.logger() level(logger) = "INFO" # The log will print INFO level or more severe messages # An example message log4r::info(logger,"Logger has started")
Once you've done this, go to the add-in and you'll see the following screen:
Here is the list of loggers you currently have in your Rstudio session
This will filter to show only the selected level and more severe messages. The heirarchy, from most to least severe, is: - FATAL - ERROR - WARNING - INFO - DEBUG
In addition to filtering by log level, you can type a filter string. You can also select the checkbox if you don't care about capitalization.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.