Skip to content
/ msgr Public

❗ This is a read-only mirror of the CRAN R package repository. msgr — Extends Messages, Warnings and Errors by Adding Levels and Log Files. Homepage: https://github.com/ChadGoymer/msgr Report bugs for this package: https://github.com/ChadGoymer/msgr/issues

License

Notifications You must be signed in to change notification settings

cran/msgr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

msgr

Build status Build status Code coverage

This package extends the message(), warning() and stop() functions by adding levels of messages and the option to record them in a log file.

Types

Messages come in three types: "INFO", "WARNING" and "ERROR", as produced by the functions info(), warn() and error(), which are equivalent to message(), warning() and stop(). respectively. When executing code the types to display can be specified as an option. For example, you can ignore "INFO" and only show "WARNING"s and "ERROR"s by setting:

options(msgr.types = c("WARNING", "ERROR"))

Levels

Whenever info(), warn() or error() are used a level can be specified, and when executing the code the levels to display can be specified as an option. The message is only shown if its level is less than, or equal to, the level option.

options(msgr.level = 1)

warn("This is an important warning!", level = 1)

info("This is useful information, but not important!", level = 3)

Log file

Message can also be written to a log file. The log file can be specified each time you use info(), warn() or error(), or you can specify it as an option.

options(msgr.log_path = "~/msgr.log")

info("This is written to console and log file")

error("This is written to console and an error log", log_path = "~/msgr-errors.log")

About

❗ This is a read-only mirror of the CRAN R package repository. msgr — Extends Messages, Warnings and Errors by Adding Levels and Log Files. Homepage: https://github.com/ChadGoymer/msgr Report bugs for this package: https://github.com/ChadGoymer/msgr/issues

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages