clustRviz_logging: 'ClustRViz' Package Logging Functionality

Description Usage Arguments Details Value Examples

Description

Control the global logging level for the clustRviz package.

Usage

1
2
3
clustRviz_logger_level(
  level = c("ERROR", "WARNING", "MESSAGE", "INFO", "DEBUG")
)

Arguments

level

The desired new log level. Available levels are

  • ERROR - corresponding to base::stop;

  • WARNING - corresponding to base::warning;

  • MESSAGE - corresponding to base::message;

  • INFO; and

  • DEBUG.

If omitted, the log level is not changed (and the current level is still returned invisibly.) See below for details about the different levels.

Details

The clustRviz package has a multi-level logging system, with a single global log level; (which applies to both R and C++ level functionality.) the levels are, in decreasing order, ERROR, WARNING, MESSAGE (default), INFO, DEBUG.

To change the amount of output from the clustRviz package, the clustRviz_logger_level function can be used to adjust the global log level. The INFO and DEBUG levels can be quite verbose and may significantly slow down the package.

Value

The previous log level (invisibly).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Switch to INFO level and fit somewhat loudly
clustRviz_logger_level("INFO")
CARP(presidential_speech)

# Return to default behavior
clustRviz_logger_level("MESSAGE")
# Will give a few messages about phases of fitting
CARP(presidential_speech)

# If we switch to ERRORs only, no progress message
clustRviz_logger_level("ERROR")
CARP(presidential_speech)

# Return to default
clustRviz_logger_level("MESSAGE")

# Normally this prints messages as the paths are calculated
CARP(presidential_speech)
# But it can be suppressed using standard R functions
suppressMessages(CARP(presidential_speech))

jjn13/clustRviz documentation built on Sept. 1, 2020, 7:53 a.m.