Learn R Programming

emil (version 1.1-6)

trace.msg: Print a timestamped and indented log message

Description

Print a timestamped and indented log message

Usage

trace.msg(level = 1, ..., time = TRUE, linebreak = TRUE, file = "")

Arguments

level
Indentation level.
...
Sent to sprintf.
time
Whether or not to print timestamp.
linebreak
Whether to finish the message with a linebreak or not.
file
Sent to cat.

Examples

Run this code
equipment <- c("flashlight", "snacks", "pick")
{
    trace.msg(1, "Begin descent")
    trace.msg(2, "Oh no, forgot the %s!", sample(equipment, 1))
    trace.msg(2, "Hello? Can you throw it down to me?", time=FALSE)
    trace.msg(1, "Aw shucks, I'm coming back up.")
}

Run the code above in your browser using DataLab