| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/io.R |
| 3 |
\name{msg_cat} |
| 4 |
\alias{msg_cat} |
| 5 |
\title{Generate a message with \code{cat()}} |
| 6 |
\usage{ |
| 7 |
msg_cat(...) |
| 8 |
} |
| 9 |
\arguments{ |
| 10 |
\item{...}{Character strings of messages, which will be concatenated into one |
| 11 |
string via \code{paste(c(...), collapse = '')}.} |
| 12 |
} |
| 13 |
\value{ |
| 14 |
Invisible \code{NULL}, with the side-effect of printing the message. |
| 15 |
} |
| 16 |
\description{ |
| 17 |
This function is similar to \code{\link[=message]{message()}}, and the difference is |
| 18 |
that \code{msg_cat()} uses \code{\link[=cat]{cat()}} to write out the message, |
| 19 |
which is sent to \code{\link[=stdout]{stdout()}} instead of \code{\link[=stderr]{stderr()}}. The |
| 20 |
message can be suppressed by \code{\link[=suppressMessages]{suppressMessages()}}. |
| 21 |
} |
| 22 |
\note{ |
| 23 |
By default, a newline will not be appended to the message. If you need |
| 24 |
a newline, you have to explicitly add it to the message (see |
| 25 |
\sQuote{Examples}). |
| 26 |
} |
| 27 |
\examples{ |
| 28 |
{ |
| 29 |
# a message without a newline at the end |
| 30 |
xfun::msg_cat("Hello world!") |
| 31 |
# add a newline at the end |
| 32 |
xfun::msg_cat(" This message appears right after the previous one.\n") |
| 33 |
} |
| 34 |
suppressMessages(xfun::msg_cat("Hello world!")) |
| 35 |
} |
| 36 |
\seealso{ |
| 37 |
This function was inspired by \code{rlang::inform()}. |
| 38 |
} |