Tell if we are logging details of session.

DESCRIPTION:

Tell if we are logging details of session.

USAGE:

verbose()

REQUIRED ARGUMENTS:

OPTIONAL ARGUMENTS:

VALUE:

This returns TRUE if you have options(verbose=T) or if the environment variable S_LOGFILE has been set (presumably to the name of a log file).

DETAILS:

The logcat function does nothing if verbose() returns FALSE, so this is not necessary for correct use of logcat. However, if it is time consuming to prepare the report for the log file, then use the idiom if(verbose()) { x<-getDetails(); logcat(x) } so as not to bother folks who do not want the logging. (Because of lazy evaluation, logcat(getDetails()) would not evaluate getDetails() unless its output were to be logged, but there may be more complicated situations where this is handy.)

REFERENCES:

SEE ALSO:

, .

EXAMPLES:

options(verbose=T)
if(verbose()) {
   logcat(paste("Current option settings are\n", paste(collapse="\n", deparse(options()))))
}
#   Note: current option settings are
#          ...