Learn R Programming

madrat (version 3.15.6)

toolstartmessage: Tool: Start message

Description

This function writes a process start message (what function was called with which arguments) and stores the current time, so the corresponding call to toolendmessage can calculate the elapsed time.

Usage

toolstartmessage(functionCallString, level = NULL)

Value

A list containing diagnostic information required by toolendmessage.

Arguments

functionCallString

A string representing the function call that should be logged

level

This argument allows to establish a hierarchy of print statements. The hierarchy is preserved for the next vcat executions. Currently this setting can have 4 states: NULL (nothing will be changed), 0 (reset hierarchies), "+" (increase hierarchy level by 1) and "-" (decrease hierarchy level by 1).

Author

Jan Philipp Dietrich, Pascal Sauer

See Also

toolendmessage, vcat

Examples

Run this code

innerFunction <- function() {
  startinfo <- madrat:::toolstartmessage("innerFunction(argumentsToPrint = 123)", "+")
  vcat(1, "inner")
  madrat:::toolendmessage(startinfo, "-")
}
outerFunction <- function() {
  startinfo <- madrat:::toolstartmessage("outerFunction()", "+")
  vcat(1, "outer")
  innerFunction()
  madrat:::toolendmessage(startinfo, "-")
}
outerFunction()

Run the code above in your browser using DataLab