msg: Message with provenance

View source: R/msg.R

msgR Documentation

Message with provenance

Description

Print message to output with a prefix including data and time, and calling function or full call stack

Usage

msg(
  ...,
  caller = NULL,
  call_depth = 1L,
  caller_id = 1L,
  newline_pre = FALSE,
  newline = TRUE,
  format_fn = plain,
  sep = " ",
  verbosity = 1L
)

msg0(
  ...,
  caller = NULL,
  call_depth = 1,
  caller_id = 1,
  newline_pre = FALSE,
  newline = TRUE,
  format_fn = plain,
  sep = "",
  verbosity = 1L
)

Arguments

...

Message to print

caller

Character: Name of calling function

call_depth

Integer: Print the system call path of this depth.

caller_id

Integer: Which function in the call stack to print

newline_pre

Logical: If TRUE begin with a new line.

newline

Logical: If TRUE end with a new line.

format_fn

Function: Formatting function to use on the message text.

sep

Character: Use to separate objects in ...

verbosity

Integer: Verbosity level of the message. If 0L, does not print anything and returns NULL, invisibly.

Details

If msg is called directly from the console, it will print ⁠[interactive>]⁠ in place of the call stack. msg0, similar to paste0, is msg(..., sep = "")

Value

If verbosity > 0L, returns a list with call, message, and date, invisibly, otherwise returns NULL invisibly.

Author(s)

EDG

Examples

msg("Hello")

rtemis.core documentation built on April 22, 2026, 1:11 a.m.