bru_log: Access methods for 'bru_log' objects

View source: R/environment.R

bru_logR Documentation

Access methods for bru_log objects

Description

Access method for bru_log objects. Note: Up to version ⁠2.8.0⁠, bru_log() was a deprecated alias for bru_log_message(). When running on ⁠2.8.0⁠ or earlier, use bru_log_get() to access the global log, and cat(fit$bru_iinla$log, sep = "\n") to print a stored estimation object log. After version ⁠2.8.0⁠, use bru_log() to access the global log, and bru_log(fit) to access a stored estimation log.

Usage

bru_log(x = NULL, verbosity = NULL)

## S3 method for class 'character'
bru_log(x, verbosity = NULL)

## S3 method for class 'bru_log'
bru_log(x, verbosity = NULL)

## S3 method for class 'iinla'
bru_log(x, verbosity = NULL)

## S3 method for class 'bru'
bru_log(x, verbosity = NULL)

## S3 method for class 'bru_log'
print(x, ..., timestamp = TRUE, verbosity = FALSE)

## S3 method for class 'bru_log'
as.character(x, ...)

## S3 method for class 'bru_log'
x[i]

## S3 method for class 'bru_log'
c(...)

## S3 method for class 'bru_log'
length(x)

Arguments

x

An object that is, contains, or can be converted to, a bru_log object. If NULL, refers to the global inlabru log.

verbosity

integer value for limiting the highest verbosity level being returned.

...

further arguments passed to or from other methods.

timestamp

If TRUE, include the timestamp of each message. Default TRUE.

i

indices specifying elements to extract. If character, denotes the sequence between bookmark i and the next bookmark (or the end of the log if i is the last bookmark)

Value

bru_log A bru_log object, containing a character vector of log messages, and potentially a vector of bookmarks.

Methods (by generic)

  • print(bru_log): Print a bru_log object with cat(x, sep = "\n"). If verbosity is TRUE, include the verbosity level of each message.

  • as.character(bru_log): Convert bru_log object to a plain character vector

  • [: Extract a subset of a bru_log object

  • c(bru_log): Concatenate several bru_log or character objects into a bru_log object.

  • length(bru_log): Obtain the number of log entries into a bru_log object.

Functions

  • bru_log(): Extract stored log messages. If non-NULL, the verbosity argument determines the maximum verbosity level of the messages to extract.

See Also

Other inlabru log methods: bru_log_bookmark(), bru_log_message(), bru_log_new(), bru_log_offset(), bru_log_reset()

Examples

bru_log(verbosity = 2L)
print(bru_log(), timestamp = TRUE, verbosity = TRUE)


fbachl/inlabru documentation built on Sept. 23, 2024, 10:14 p.m.