Logging | R Documentation |
R6 class managing logging
messages
Array of messages to log.
Each element of messages
is a list
that includes time
, type
and text
of message to log.
folder
Folder where log files are saved
info()
Add an Info
message to log
Logging$info(text, display = NULL)
text
content of the Info
message
display
Logical setting if message is displayed on console
error()
Add an Error
message to log
Logging$error(text, display = NULL)
text
content of the Error
message
display
Logical setting if message is displayed on console
debug()
Add a Debug
message to log
Logging$debug(text, display = NULL)
text
content of the Debug
message
display
Logical setting if message is displayed on console
textToMessage()
Add meta data to text
to create an informative message to log
with a flag for its logType
("Info"
, "Error"
, or "Debug"
)
Logging$textToMessage(text, logType)
text
content of the message
logType
type of message ("Info"
, "Error"
, or "Debug"
)
addMessage()
Add a message to the list of logged messages
Logging$addMessage(message)
message
content of the message
showMessages()
Display logged messages
as a data.frame
Can be filtered according to logTypes
("Info"
, "Error"
, and/or "Debug"
)
Logging$showMessages(logTypes = LogTypes)
logTypes
types of message ("Info"
, "Error"
, or "Debug"
)
printMessage()
Print the log messages on R/RStudio console
Logging$printMessage(message, display = NULL)
message
Message to print
display
Logical setting if message is displayed on console
saveMessage()
Write a message in its log file
Logging$saveMessage(message)
message
Message to print
writeAsJson()
Write the log messages in a json log file
Logging$writeAsJson(fileName)
fileName
Name of json log file
write()
Write the log messages in txt log files
Logging$write()
reset()
Reset/empty log messages
Logging$reset(folder = NULL)
folder
Folder where logs are saved
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.