Skip to contents

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

Examples

bru_log(verbosity = 2L)
#> 2024-12-18 14:20:26.6885: inlabru loaded
#> 2024-12-18 14:20:26.689023: Clear override options
#> 2024-12-18 14:20:31.690589: iinla: Iteration 1 [max:1]
#> 2024-12-18 14:20:32.440439: iinla: Iteration 1 [max:10]
#> 2024-12-18 14:20:32.900707: iinla: Iteration 2 [max:10]
#> 2024-12-18 14:20:33.630122: iinla: Max deviation from previous: 0.222% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive]
#> 2024-12-18 14:20:33.630552: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode.
#> 2024-12-18 14:20:33.631473: iinla: Iteration 3 [max:10]
#> 2024-12-18 14:20:34.200644: iinla: Iteration 1 [max:10]
#> 2024-12-18 14:20:34.606713: iinla: Step rescaling: 27.2% (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2)
#> 2024-12-18 14:20:34.643955: iinla: Iteration 2 [max:10]
#> 2024-12-18 14:20:35.055792: iinla: Step rescaling: 99.6% (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4)
#> 2024-12-18 14:20:35.087166: iinla: Max deviation from previous: 52900% of SD, and line search is active
#>        [stop if: <10% and line search inactive]
#> 2024-12-18 14:20:35.088193: iinla: Iteration 3 [max:10]
#> 2024-12-18 14:20:35.513264: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89)
#> 2024-12-18 14:20:35.543425: iinla: Max deviation from previous: 599% of SD, and line search is active
#>        [stop if: <10% and line search inactive]
#> 2024-12-18 14:20:35.544363: iinla: Iteration 4 [max:10]
#> 2024-12-18 14:20:36.010225: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive]
#> 2024-12-18 14:20:36.011169: iinla: Iteration 5 [max:10]
#> 2024-12-18 14:20:36.462587: iinla: Max deviation from previous: 0.111% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive]
#> 2024-12-18 14:20:36.462999: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode.
#> 2024-12-18 14:20:36.463887: iinla: Iteration 6 [max:10]
#> 2024-12-18 14:20:40.300231: iinla: Iteration 1 [max:1]
print(bru_log(), timestamp = TRUE, verbosity = TRUE)
#> 2024-12-18 14:20:26.6885: inlabru loaded (level 1)
#> 2024-12-18 14:20:26.689023: Clear override options (level 1)
#> 2024-12-18 14:20:31.591931: iinla: Evaluate component inputs (level 3)
#> 2024-12-18 14:20:31.615906: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:31.616592: Linearise component 'x' (level 4)
#> 2024-12-18 14:20:31.634342: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:31.641711: iinla: Evaluate component simplifications (level 3)
#> 2024-12-18 14:20:31.642379: Simplify component 'x' (level 4)
#> 2024-12-18 14:20:31.650259: Simplify component 'Intercept' (level 4)
#> 2024-12-18 14:20:31.657493: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:31.668773: iinla: Construct inla stack (level 3)
#> 2024-12-18 14:20:31.690143: iinla: Model initialisation completed (level 3)
#> 2024-12-18 14:20:31.690589: iinla: Iteration 1 [max:1] (level 1)
#> 2024-12-18 14:20:32.364596: iinla: Evaluate component inputs (level 3)
#> 2024-12-18 14:20:32.387563: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:32.388053: Linearise component 'x' (level 4)
#> 2024-12-18 14:20:32.397035: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:32.40435: iinla: Evaluate component simplifications (level 3)
#> 2024-12-18 14:20:32.404844: Simplify component 'x' (level 4)
#> 2024-12-18 14:20:32.412597: Simplify component 'Intercept' (level 4)
#> 2024-12-18 14:20:32.419874: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:32.421341: Linearise with respect to component 'x' (level 4)
#> 2024-12-18 14:20:32.426362: Linearise with respect to component 'Intercept' (level 4)
#> 2024-12-18 14:20:32.428633: iinla: Construct inla stack (level 3)
#> 2024-12-18 14:20:32.439992: iinla: Model initialisation completed (level 3)
#> 2024-12-18 14:20:32.440439: iinla: Iteration 1 [max:10] (level 1)
#> 2024-12-18 14:20:32.868106: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 343.2, norm1 = 0, norm01 = 343.2) (level 3)
#> 2024-12-18 14:20:32.868574: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2024-12-18 14:20:32.869005: iinla: |lin1-lin0| = 343.2
#>        <eta-lin1,delta>/|delta| = 0
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 3.109e-14 (level 4)
#> 2024-12-18 14:20:32.869878: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:32.870358: Linearise component 'x' (level 4)
#> 2024-12-18 14:20:32.878542: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:32.88583: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:32.886901: Linearise with respect to component 'x' (level 4)
#> 2024-12-18 14:20:32.889093: Linearise with respect to component 'Intercept' (level 4)
#> 2024-12-18 14:20:32.900707: iinla: Iteration 2 [max:10] (level 1)
#> 2024-12-18 14:20:33.595772: iinla: Step rescaling: 162%, Expand (norm0 = 7.367e-07, norm1 = 2.814e-07, norm01 = 4.553e-07) (level 3)
#> 2024-12-18 14:20:33.596877: iinla: Step rescaling: 100%, Overstep (norm0 = 4.553e-07, norm1 = 3.78e-14, norm01 = 4.553e-07) (level 3)
#> 2024-12-18 14:20:33.598538: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 4.553e-07, norm1 = 3.78e-14, norm01 = 4.553e-07) (level 3)
#> 2024-12-18 14:20:33.598943: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2024-12-18 14:20:33.59935: 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)
#> 2024-12-18 14:20:33.600213: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:33.600646: Linearise component 'x' (level 4)
#> 2024-12-18 14:20:33.608566: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:33.615827: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:33.616904: Linearise with respect to component 'x' (level 4)
#> 2024-12-18 14:20:33.618971: Linearise with respect to component 'Intercept' (level 4)
#> 2024-12-18 14:20:33.630122: iinla: Max deviation from previous: 0.222% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-12-18 14:20:33.630552: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode. (level 1)
#> 2024-12-18 14:20:33.631473: iinla: Iteration 3 [max:10] (level 1)
#> 2024-12-18 14:20:34.131222: iinla: Evaluate component inputs (level 3)
#> 2024-12-18 14:20:34.154139: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:34.154625: Linearise component 'z' (level 4)
#> 2024-12-18 14:20:34.161932: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:34.168976: iinla: Evaluate component simplifications (level 3)
#> 2024-12-18 14:20:34.169442: Simplify component 'z' (level 4)
#> 2024-12-18 14:20:34.176548: Simplify component 'Intercept' (level 4)
#> 2024-12-18 14:20:34.183571: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:34.18466: Linearise with respect to component 'z' (level 4)
#> 2024-12-18 14:20:34.186962: Linearise with respect to component 'Intercept' (level 4)
#> 2024-12-18 14:20:34.189017: iinla: Construct inla stack (level 3)
#> 2024-12-18 14:20:34.200212: iinla: Model initialisation completed (level 3)
#> 2024-12-18 14:20:34.200644: iinla: Iteration 1 [max:10] (level 1)
#> 2024-12-18 14:20:34.602979: iinla: Step rescaling: 61.8%, Contract (norm0 = 2292, norm1 = 2107, norm01 = 395.2) (level 3)
#> 2024-12-18 14:20:34.604103: iinla: Step rescaling: 38.2%, Contract (norm0 = 460.2, norm1 = 339.3, norm01 = 395.2) (level 3)
#> 2024-12-18 14:20:34.605746: iinla: Step rescaling: 27.2%, Approx Optimisation (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2) (level 3)
#> 2024-12-18 14:20:34.606275: iinla: |lin1-lin0| = 395.2
#>        <eta-lin1,delta>/|delta| = -225.8
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 121.3 (level 4)
#> 2024-12-18 14:20:34.606713: iinla: Step rescaling: 27.2% (norm0 = 208.3, norm1 = 256.3, norm01 = 395.2) (level 2)
#> 2024-12-18 14:20:34.607575: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:34.608024: Linearise component 'z' (level 4)
#> 2024-12-18 14:20:34.621568: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:34.62873: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:34.630208: Linearise with respect to component 'z' (level 4)
#> 2024-12-18 14:20:34.632451: Linearise with respect to component 'Intercept' (level 4)
#> 2024-12-18 14:20:34.643955: iinla: Iteration 2 [max:10] (level 1)
#> 2024-12-18 14:20:35.05486: iinla: Step rescaling: 99.6%, Approx Optimisation (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4) (level 3)
#> 2024-12-18 14:20:35.055376: iinla: |lin1-lin0| = 256.4
#>        <eta-lin1,delta>/|delta| = -1.292
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 12.83 (level 4)
#> 2024-12-18 14:20:35.055792: iinla: Step rescaling: 99.6% (norm0 = 255.4, norm1 = 12.89, norm01 = 256.4) (level 2)
#> 2024-12-18 14:20:35.056647: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:35.057085: Linearise component 'z' (level 4)
#> 2024-12-18 14:20:35.064803: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:35.072207: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:35.0733: Linearise with respect to component 'z' (level 4)
#> 2024-12-18 14:20:35.075667: Linearise with respect to component 'Intercept' (level 4)
#> 2024-12-18 14:20:35.087166: iinla: Max deviation from previous: 52900% of SD, and line search is active
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-12-18 14:20:35.088193: iinla: Iteration 3 [max:10] (level 1)
#> 2024-12-18 14:20:35.509616: iinla: Step rescaling: 162%, Expand (norm0 = 20.29, norm1 = 7.4, norm01 = 12.89) (level 3)
#> 2024-12-18 14:20:35.510829: iinla: Step rescaling: 100%, Overstep (norm0 = 12.67, norm1 = 0.2192, norm01 = 12.89) (level 3)
#> 2024-12-18 14:20:35.512411: iinla: Step rescaling: 101.8%, Approx Optimisation (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 3)
#> 2024-12-18 14:20:35.512869: iinla: |lin1-lin0| = 12.89
#>        <eta-lin1,delta>/|delta| = -2.965e-05
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 0.01798 (level 4)
#> 2024-12-18 14:20:35.513264: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 2)
#> 2024-12-18 14:20:35.514152: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:35.514604: Linearise component 'z' (level 4)
#> 2024-12-18 14:20:35.522015: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:35.529128: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:35.530164: Linearise with respect to component 'z' (level 4)
#> 2024-12-18 14:20:35.532416: Linearise with respect to component 'Intercept' (level 4)
#> 2024-12-18 14:20:35.543425: iinla: Max deviation from previous: 599% of SD, and line search is active
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-12-18 14:20:35.544363: iinla: Iteration 4 [max:10] (level 1)
#> 2024-12-18 14:20:35.976052: iinla: Step rescaling: 162%, Expand (norm0 = 0.02912, norm1 = 0.01112, norm01 = 0.018) (level 3)
#> 2024-12-18 14:20:35.977214: iinla: Step rescaling: 100%, Overstep (norm0 = 0.018, norm1 = 1.151e-07, norm01 = 0.018) (level 3)
#> 2024-12-18 14:20:35.978985: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 0.018, norm1 = 1.147e-07, norm01 = 0.018) (level 3)
#> 2024-12-18 14:20:35.979454: 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)
#> 2024-12-18 14:20:35.980314: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:35.980757: Linearise component 'z' (level 4)
#> 2024-12-18 14:20:35.988393: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:35.995691: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:35.996743: Linearise with respect to component 'z' (level 4)
#> 2024-12-18 14:20:35.999088: Linearise with respect to component 'Intercept' (level 4)
#> 2024-12-18 14:20:36.010225: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-12-18 14:20:36.011169: iinla: Iteration 5 [max:10] (level 1)
#> 2024-12-18 14:20:36.429436: iinla: Step rescaling: 162%, Expand (norm0 = 3.436e-07, norm1 = 1.312e-07, norm01 = 2.123e-07) (level 3)
#> 2024-12-18 14:20:36.430532: iinla: Step rescaling: 100%, Overstep (norm0 = 2.123e-07, norm1 = 8.273e-13, norm01 = 2.123e-07) (level 3)
#> 2024-12-18 14:20:36.432102: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 2.123e-07, norm1 = 7.25e-13, norm01 = 2.123e-07) (level 3)
#> 2024-12-18 14:20:36.432555: 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)
#> 2024-12-18 14:20:36.433406: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:36.43384: Linearise component 'z' (level 4)
#> 2024-12-18 14:20:36.441246: Linearise component 'Intercept' (level 4)
#> 2024-12-18 14:20:36.448444: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:36.44945: Linearise with respect to component 'z' (level 4)
#> 2024-12-18 14:20:36.451706: Linearise with respect to component 'Intercept' (level 4)
#> 2024-12-18 14:20:36.462587: iinla: Max deviation from previous: 0.111% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-12-18 14:20:36.462999: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode. (level 1)
#> 2024-12-18 14:20:36.463887: iinla: Iteration 6 [max:10] (level 1)
#> 2024-12-18 14:20:40.219068: iinla: Evaluate component inputs (level 3)
#> 2024-12-18 14:20:40.244526: iinla: Evaluate component linearisations (level 3)
#> 2024-12-18 14:20:40.245091: Linearise component 'x' (level 4)
#> 2024-12-18 14:20:40.255072: Linearise component 'x' (level 4)
#> 2024-12-18 14:20:40.262984: iinla: Evaluate component simplifications (level 3)
#> 2024-12-18 14:20:40.263536: Simplify component 'x' (level 4)
#> 2024-12-18 14:20:40.271392: Simplify component 'x' (level 4)
#> 2024-12-18 14:20:40.279238: iinla: Evaluate predictor linearisation (level 3)
#> 2024-12-18 14:20:40.285013: iinla: Construct inla stack (level 3)
#> 2024-12-18 14:20:40.299753: iinla: Model initialisation completed (level 3)
#> 2024-12-18 14:20:40.300231: iinla: Iteration 1 [max:1] (level 1)