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. IfNULL
, refers to the globalinlabru
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. DefaultTRUE
.- i
indices specifying elements to extract. If
character
, denotes the sequence between bookmarki
and the next bookmark (or the end of the log ifi
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 abru_log
object withcat(x, sep = "\n")
. Ifverbosity
isTRUE
, include the verbosity level of each message.as.character(bru_log)
: Convertbru_log
object to a plaincharacter
vector[
: Extract a subset of abru_log
objectc(bru_log)
: Concatenate severalbru_log
orcharacter
objects into abru_log
object.length(bru_log)
: Obtain the number of log entries into abru_log
object.
Functions
bru_log()
: Extract stored log messages. If non-NULL
, theverbosity
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)
#> 2025-03-20 12:27:01.542927: inlabru loaded
#> 2025-03-20 12:27:01.543372: Clear override options
#> 2025-03-20 12:27:06.510116: iinla: Iteration 1 [max:1]
#> 2025-03-20 12:27:07.212535: iinla: Iteration 1 [max:10]
#> 2025-03-20 12:27:07.663586: iinla: Iteration 2 [max:10]
#> 2025-03-20 12:27:08.344176: iinla: Max deviation from previous: 0.222% of SD, and line search is inactive
#> [stop if: <10% and line search inactive]
#> 2025-03-20 12:27:08.344587: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode.
#> 2025-03-20 12:27:08.345512: iinla: Iteration 3 [max:10]
#> 2025-03-20 12:27:08.940776: iinla: Iteration 1 [max:10]
#> 2025-03-20 12:27:09.331551: iinla: Step rescaling: 27.2% (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2)
#> 2025-03-20 12:27:09.365969: iinla: Iteration 2 [max:10]
#> 2025-03-20 12:27:09.764682: iinla: Step rescaling: 99.6% (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4)
#> 2025-03-20 12:27:09.795268: iinla: Max deviation from previous: 52900% of SD, and line search is active
#> [stop if: <10% and line search inactive]
#> 2025-03-20 12:27:09.796241: iinla: Iteration 3 [max:10]
#> 2025-03-20 12:27:10.198318: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89)
#> 2025-03-20 12:27:10.228436: iinla: Max deviation from previous: 599% of SD, and line search is active
#> [stop if: <10% and line search inactive]
#> 2025-03-20 12:27:10.229379: iinla: Iteration 4 [max:10]
#> 2025-03-20 12:27:10.685927: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#> [stop if: <10% and line search inactive]
#> 2025-03-20 12:27:10.686912: iinla: Iteration 5 [max:10]
#> 2025-03-20 12:27:11.123302: iinla: Max deviation from previous: 0.111% of SD, and line search is inactive
#> [stop if: <10% and line search inactive]
#> 2025-03-20 12:27:11.123703: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode.
#> 2025-03-20 12:27:11.124596: iinla: Iteration 6 [max:10]
#> 2025-03-20 12:27:14.416114: iinla: Iteration 1 [max:1]
print(bru_log(), timestamp = TRUE, verbosity = TRUE)
#> 2025-03-20 12:27:01.542927: inlabru loaded (level 1)
#> 2025-03-20 12:27:01.543372: Clear override options (level 1)
#> 2025-03-20 12:27:06.4136: iinla: Evaluate component inputs (level 3)
#> 2025-03-20 12:27:06.43611: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:06.436736: Linearise component 'x' (level 4)
#> 2025-03-20 12:27:06.453626: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:06.461011: iinla: Evaluate component simplifications (level 3)
#> 2025-03-20 12:27:06.461577: Simplify component 'x' (level 4)
#> 2025-03-20 12:27:06.469428: Simplify component 'Intercept' (level 4)
#> 2025-03-20 12:27:06.476701: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:06.488029: iinla: Construct inla stack (level 3)
#> 2025-03-20 12:27:06.50965: iinla: Model initialisation completed (level 3)
#> 2025-03-20 12:27:06.510116: iinla: Iteration 1 [max:1] (level 1)
#> 2025-03-20 12:27:07.124034: iinla: Evaluate component inputs (level 3)
#> 2025-03-20 12:27:07.148677: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:07.149208: Linearise component 'x' (level 4)
#> 2025-03-20 12:27:07.169103: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:07.176441: iinla: Evaluate component simplifications (level 3)
#> 2025-03-20 12:27:07.176971: Simplify component 'x' (level 4)
#> 2025-03-20 12:27:07.184566: Simplify component 'Intercept' (level 4)
#> 2025-03-20 12:27:07.191832: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:07.193359: Linearise with respect to component 'x' (level 4)
#> 2025-03-20 12:27:07.198439: Linearise with respect to component 'Intercept' (level 4)
#> 2025-03-20 12:27:07.200662: iinla: Construct inla stack (level 3)
#> 2025-03-20 12:27:07.212113: iinla: Model initialisation completed (level 3)
#> 2025-03-20 12:27:07.212535: iinla: Iteration 1 [max:10] (level 1)
#> 2025-03-20 12:27:07.625355: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 343.2, norm1 = 0, norm01 = 343.2) (level 3)
#> 2025-03-20 12:27:07.631282: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2025-03-20 12:27:07.631743: iinla: |lin1-lin0| = 343.2
#> <eta-lin1,delta>/|delta| = 0
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 3.109e-14 (level 4)
#> 2025-03-20 12:27:07.632623: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:07.633091: Linearise component 'x' (level 4)
#> 2025-03-20 12:27:07.6411: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:07.648392: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:07.649817: Linearise with respect to component 'x' (level 4)
#> 2025-03-20 12:27:07.651998: Linearise with respect to component 'Intercept' (level 4)
#> 2025-03-20 12:27:07.663586: iinla: Iteration 2 [max:10] (level 1)
#> 2025-03-20 12:27:08.309889: iinla: Step rescaling: 162%, Expand (norm0 = 7.367e-07, norm1 = 2.814e-07, norm01 = 4.553e-07) (level 3)
#> 2025-03-20 12:27:08.311017: iinla: Step rescaling: 100%, Overstep (norm0 = 4.553e-07, norm1 = 3.78e-14, norm01 = 4.553e-07) (level 3)
#> 2025-03-20 12:27:08.312663: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 4.553e-07, norm1 = 3.78e-14, norm01 = 4.553e-07) (level 3)
#> 2025-03-20 12:27:08.313104: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2025-03-20 12:27:08.313513: iinla: |lin1-lin0| = 4.553e-07
#> <eta-lin1,delta>/|delta| = -4.086e-15
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 3.758e-14 (level 4)
#> 2025-03-20 12:27:08.314387: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:08.314826: Linearise component 'x' (level 4)
#> 2025-03-20 12:27:08.322791: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:08.329937: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:08.330965: Linearise with respect to component 'x' (level 4)
#> 2025-03-20 12:27:08.333101: Linearise with respect to component 'Intercept' (level 4)
#> 2025-03-20 12:27:08.344176: iinla: Max deviation from previous: 0.222% of SD, and line search is inactive
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-03-20 12:27:08.344587: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode. (level 1)
#> 2025-03-20 12:27:08.345512: iinla: Iteration 3 [max:10] (level 1)
#> 2025-03-20 12:27:08.870415: iinla: Evaluate component inputs (level 3)
#> 2025-03-20 12:27:08.894174: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:08.894696: Linearise component 'z' (level 4)
#> 2025-03-20 12:27:08.902046: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:08.909042: iinla: Evaluate component simplifications (level 3)
#> 2025-03-20 12:27:08.909511: Simplify component 'z' (level 4)
#> 2025-03-20 12:27:08.916533: Simplify component 'Intercept' (level 4)
#> 2025-03-20 12:27:08.923534: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:08.924668: Linearise with respect to component 'z' (level 4)
#> 2025-03-20 12:27:08.926996: Linearise with respect to component 'Intercept' (level 4)
#> 2025-03-20 12:27:08.929051: iinla: Construct inla stack (level 3)
#> 2025-03-20 12:27:08.94031: iinla: Model initialisation completed (level 3)
#> 2025-03-20 12:27:08.940776: iinla: Iteration 1 [max:10] (level 1)
#> 2025-03-20 12:27:09.32803: iinla: Step rescaling: 61.8%, Contract (norm0 = 2292, norm1 = 2107, norm01 = 395.2) (level 3)
#> 2025-03-20 12:27:09.329064: iinla: Step rescaling: 38.2%, Contract (norm0 = 460.2, norm1 = 339.3, norm01 = 395.2) (level 3)
#> 2025-03-20 12:27:09.330618: iinla: Step rescaling: 27.2%, Approx Optimisation (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2) (level 3)
#> 2025-03-20 12:27:09.331166: iinla: |lin1-lin0| = 395.2
#> <eta-lin1,delta>/|delta| = -225.8
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 121.3 (level 4)
#> 2025-03-20 12:27:09.331551: iinla: Step rescaling: 27.2% (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2) (level 2)
#> 2025-03-20 12:27:09.3324: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:09.332842: Linearise component 'z' (level 4)
#> 2025-03-20 12:27:09.344471: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:09.351459: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:09.352655: Linearise with respect to component 'z' (level 4)
#> 2025-03-20 12:27:09.354876: Linearise with respect to component 'Intercept' (level 4)
#> 2025-03-20 12:27:09.365969: iinla: Iteration 2 [max:10] (level 1)
#> 2025-03-20 12:27:09.763802: iinla: Step rescaling: 99.6%, Approx Optimisation (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4) (level 3)
#> 2025-03-20 12:27:09.76429: iinla: |lin1-lin0| = 256.4
#> <eta-lin1,delta>/|delta| = -1.292
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 12.83 (level 4)
#> 2025-03-20 12:27:09.764682: iinla: Step rescaling: 99.6% (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4) (level 2)
#> 2025-03-20 12:27:09.765779: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:09.76621: Linearise component 'z' (level 4)
#> 2025-03-20 12:27:09.773457: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:09.780574: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:09.781633: Linearise with respect to component 'z' (level 4)
#> 2025-03-20 12:27:09.783961: Linearise with respect to component 'Intercept' (level 4)
#> 2025-03-20 12:27:09.795268: iinla: Max deviation from previous: 52900% of SD, and line search is active
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-03-20 12:27:09.796241: iinla: Iteration 3 [max:10] (level 1)
#> 2025-03-20 12:27:10.194851: iinla: Step rescaling: 162%, Expand (norm0 = 20.29, norm1 = 7.4, norm01 = 12.89) (level 3)
#> 2025-03-20 12:27:10.195906: iinla: Step rescaling: 100%, Overstep (norm0 = 12.67, norm1 = 0.2192, norm01 = 12.89) (level 3)
#> 2025-03-20 12:27:10.197464: iinla: Step rescaling: 101.8%, Approx Optimisation (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 3)
#> 2025-03-20 12:27:10.197922: iinla: |lin1-lin0| = 12.89
#> <eta-lin1,delta>/|delta| = -2.965e-05
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 0.01798 (level 4)
#> 2025-03-20 12:27:10.198318: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 2)
#> 2025-03-20 12:27:10.199211: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:10.199645: Linearise component 'z' (level 4)
#> 2025-03-20 12:27:10.20695: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:10.214136: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:10.215158: Linearise with respect to component 'z' (level 4)
#> 2025-03-20 12:27:10.217429: Linearise with respect to component 'Intercept' (level 4)
#> 2025-03-20 12:27:10.228436: iinla: Max deviation from previous: 599% of SD, and line search is active
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-03-20 12:27:10.229379: iinla: Iteration 4 [max:10] (level 1)
#> 2025-03-20 12:27:10.652417: iinla: Step rescaling: 162%, Expand (norm0 = 0.02912, norm1 = 0.01112, norm01 = 0.018) (level 3)
#> 2025-03-20 12:27:10.653492: iinla: Step rescaling: 100%, Overstep (norm0 = 0.018, norm1 = 1.151e-07, norm01 = 0.018) (level 3)
#> 2025-03-20 12:27:10.655275: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 0.018, norm1 = 1.147e-07, norm01 = 0.018) (level 3)
#> 2025-03-20 12:27:10.655738: iinla: |lin1-lin0| = 0.018
#> <eta-lin1,delta>/|delta| = 1.968e-10
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 1.147e-07 (level 4)
#> 2025-03-20 12:27:10.65659: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:10.657041: Linearise component 'z' (level 4)
#> 2025-03-20 12:27:10.664321: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:10.671413: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:10.672516: Linearise with respect to component 'z' (level 4)
#> 2025-03-20 12:27:10.674801: Linearise with respect to component 'Intercept' (level 4)
#> 2025-03-20 12:27:10.685927: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-03-20 12:27:10.686912: iinla: Iteration 5 [max:10] (level 1)
#> 2025-03-20 12:27:11.09044: iinla: Step rescaling: 162%, Expand (norm0 = 3.436e-07, norm1 = 1.312e-07, norm01 = 2.123e-07) (level 3)
#> 2025-03-20 12:27:11.091478: iinla: Step rescaling: 100%, Overstep (norm0 = 2.123e-07, norm1 = 8.273e-13, norm01 = 2.123e-07) (level 3)
#> 2025-03-20 12:27:11.093224: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 2.123e-07, norm1 = 7.25e-13, norm01 = 2.123e-07) (level 3)
#> 2025-03-20 12:27:11.093665: iinla: |lin1-lin0| = 2.123e-07
#> <eta-lin1,delta>/|delta| = 3.094e-14
#> |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 7.244e-13 (level 4)
#> 2025-03-20 12:27:11.094513: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:11.094954: Linearise component 'z' (level 4)
#> 2025-03-20 12:27:11.102128: Linearise component 'Intercept' (level 4)
#> 2025-03-20 12:27:11.109093: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:11.110123: Linearise with respect to component 'z' (level 4)
#> 2025-03-20 12:27:11.11235: Linearise with respect to component 'Intercept' (level 4)
#> 2025-03-20 12:27:11.123302: iinla: Max deviation from previous: 0.111% of SD, and line search is inactive
#> [stop if: <10% and line search inactive] (level 1)
#> 2025-03-20 12:27:11.123703: iinla: Convergence criterion met.
#> Running final INLA integration step with known theta mode. (level 1)
#> 2025-03-20 12:27:11.124596: iinla: Iteration 6 [max:10] (level 1)
#> 2025-03-20 12:27:14.336234: iinla: Evaluate component inputs (level 3)
#> 2025-03-20 12:27:14.363208: iinla: Evaluate component linearisations (level 3)
#> 2025-03-20 12:27:14.363766: Linearise component 'x' (level 4)
#> 2025-03-20 12:27:14.373106: Linearise component 'x' (level 4)
#> 2025-03-20 12:27:14.380654: iinla: Evaluate component simplifications (level 3)
#> 2025-03-20 12:27:14.381168: Simplify component 'x' (level 4)
#> 2025-03-20 12:27:14.388724: Simplify component 'x' (level 4)
#> 2025-03-20 12:27:14.396257: iinla: Evaluate predictor linearisation (level 3)
#> 2025-03-20 12:27:14.401502: iinla: Construct inla stack (level 3)
#> 2025-03-20 12:27:14.415647: iinla: Model initialisation completed (level 3)
#> 2025-03-20 12:27:14.416114: iinla: Iteration 1 [max:1] (level 1)