MyNixOS website logo
Description

Extends Messages, Warnings and Errors by Adding Levels and Log Files.

Provides new functions info(), warn() and error(), similar to message(), warning() and stop() respectively. However, the new functions can have a 'level' associated with them, so that when executed the global level option determines whether they are shown or not. This allows debug modes, outputting more information. The can also output all messages to a log file.

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")
Metadata

Version

1.1.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows