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-07-10 12:14:31.63545: inlabru loaded
#> 2024-07-10 12:14:31.635992: Clear override options
#> 2024-07-10 12:14:36.651214: iinla: Iteration 1 [max:1]
#> 2024-07-10 12:14:37.38786: iinla: Iteration 1 [max:10]
#> 2024-07-10 12:14:37.83592: iinla: Iteration 2 [max:10]
#> 2024-07-10 12:14:38.540324: iinla: Max deviation from previous: 0.139% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive]
#> 2024-07-10 12:14:38.540748: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode.
#> 2024-07-10 12:14:38.541695: iinla: Iteration 3 [max:10]
#> 2024-07-10 12:14:39.103688: iinla: Iteration 1 [max:10]
#> 2024-07-10 12:14:39.471429: iinla: Step rescaling: 27.2% (norm0 = 208.4, norm1 = 256.3, norm01 = 395.2)
#> 2024-07-10 12:14:39.501614: iinla: Iteration 2 [max:10]
#> 2024-07-10 12:14:39.871531: iinla: Step rescaling: 99.6% (norm0 = 255.3, norm1 = 12.89, norm01 = 256.3)
#> 2024-07-10 12:14:39.900884: iinla: Max deviation from previous: 52900% of SD, and line search is active
#>        [stop if: <10% and line search inactive]
#> 2024-07-10 12:14:39.901855: iinla: Iteration 3 [max:10]
#> 2024-07-10 12:14:40.270493: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89)
#> 2024-07-10 12:14:40.305888: iinla: Max deviation from previous: 598% of SD, and line search is active
#>        [stop if: <10% and line search inactive]
#> 2024-07-10 12:14:40.306854: iinla: Iteration 4 [max:10]
#> 2024-07-10 12:14:40.699177: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive]
#> 2024-07-10 12:14:40.70022: iinla: Iteration 5 [max:10]
#> 2024-07-10 12:14:41.098337: iinla: Max deviation from previous: 0.0579% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive]
#> 2024-07-10 12:14:41.098781: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode.
#> 2024-07-10 12:14:41.099693: iinla: Iteration 6 [max:10]
#> 2024-07-10 12:14:44.218656: iinla: Iteration 1 [max:1]
#> 2024-07-10 12:14:44.789187: iinla: Iteration 1 [max:1]
#> 2024-07-10 12:14:45.450377: iinla: Iteration 1 [max:10]
#> 2024-07-10 12:14:45.918789: iinla: Iteration 2 [max:10]
#> 2024-07-10 12:14:46.389917: iinla: Max deviation from previous: 0.146% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive]
#> 2024-07-10 12:14:46.390373: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode.
#> 2024-07-10 12:14:46.391323: iinla: Iteration 3 [max:10]
print(bru_log(), timestamp = TRUE, verbosity = TRUE)
#> 2024-07-10 12:14:31.63545: inlabru loaded (level 1)
#> 2024-07-10 12:14:31.635992: Clear override options (level 1)
#> 2024-07-10 12:14:36.545997: iinla: Evaluate component inputs (level 3)
#> 2024-07-10 12:14:36.570364: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:36.601324: iinla: Evaluate component simplifications (level 3)
#> 2024-07-10 12:14:36.616652: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:36.628857: iinla: Construct inla stack (level 3)
#> 2024-07-10 12:14:36.650728: iinla: Model initialisation completed (level 3)
#> 2024-07-10 12:14:36.651214: iinla: Iteration 1 [max:1] (level 1)
#> 2024-07-10 12:14:37.31279: iinla: Evaluate component inputs (level 3)
#> 2024-07-10 12:14:37.336611: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:37.352766: iinla: Evaluate component simplifications (level 3)
#> 2024-07-10 12:14:37.367727: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:37.375903: iinla: Construct inla stack (level 3)
#> 2024-07-10 12:14:37.387387: iinla: Model initialisation completed (level 3)
#> 2024-07-10 12:14:37.38786: iinla: Iteration 1 [max:10] (level 1)
#> 2024-07-10 12:14:37.804951: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 343.3, norm1 = 0, norm01 = 343.3) (level 3)
#> 2024-07-10 12:14:37.805414: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2024-07-10 12:14:37.80584: iinla: |lin1-lin0| = 343.3
#>        <eta-lin1,delta>/|delta| = 0
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 1.433e-14 (level 4)
#> 2024-07-10 12:14:37.8067: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:37.822044: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:37.83592: iinla: Iteration 2 [max:10] (level 1)
#> 2024-07-10 12:14:38.510656: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 2.859e-07, norm1 = 3.292e-14, norm01 = 2.859e-07) (level 3)
#> 2024-07-10 12:14:38.511235: iinla: |lin1-lin0| = 2.859e-07
#>        <eta-lin1,delta>/|delta| = 3.737e-15
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 3.271e-14 (level 4)
#> 2024-07-10 12:14:38.512179: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:38.527255: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:38.540324: iinla: Max deviation from previous: 0.139% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-07-10 12:14:38.540748: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode. (level 1)
#> 2024-07-10 12:14:38.541695: iinla: Iteration 3 [max:10] (level 1)
#> 2024-07-10 12:14:39.027305: iinla: Evaluate component inputs (level 3)
#> 2024-07-10 12:14:39.051401: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:39.072505: iinla: Evaluate component simplifications (level 3)
#> 2024-07-10 12:14:39.087105: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:39.092133: iinla: Construct inla stack (level 3)
#> 2024-07-10 12:14:39.103253: iinla: Model initialisation completed (level 3)
#> 2024-07-10 12:14:39.103688: iinla: Iteration 1 [max:10] (level 1)
#> 2024-07-10 12:14:39.467788: iinla: Step rescaling: 61.8%, Contract (norm0 = 2293, norm1 = 2107, norm01 = 395.2) (level 3)
#> 2024-07-10 12:14:39.468818: iinla: Step rescaling: 38.2%, Contract (norm0 = 460.2, norm1 = 339.4, norm01 = 395.2) (level 3)
#> 2024-07-10 12:14:39.470568: iinla: Step rescaling: 27.2%, Approx Optimisation (norm0 = 208.4, norm1 = 256.3, norm01 = 395.2) (level 3)
#> 2024-07-10 12:14:39.471028: iinla: |lin1-lin0| = 395.2
#>        <eta-lin1,delta>/|delta| = -225.8
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 121.3 (level 4)
#> 2024-07-10 12:14:39.471429: iinla: Step rescaling: 27.2% (norm0 = 208.4, norm1 = 256.3, norm01 = 395.2) (level 2)
#> 2024-07-10 12:14:39.47227: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:39.487463: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:39.501614: iinla: Iteration 2 [max:10] (level 1)
#> 2024-07-10 12:14:39.870635: iinla: Step rescaling: 99.6%, Approx Optimisation (norm0 = 255.3, norm1 = 12.89, norm01 = 256.3) (level 3)
#> 2024-07-10 12:14:39.871131: iinla: |lin1-lin0| = 256.3
#>        <eta-lin1,delta>/|delta| = -1.292
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 12.82 (level 4)
#> 2024-07-10 12:14:39.871531: iinla: Step rescaling: 99.6% (norm0 = 255.3, norm1 = 12.89, norm01 = 256.3) (level 2)
#> 2024-07-10 12:14:39.872374: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:39.887475: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:39.900884: iinla: Max deviation from previous: 52900% of SD, and line search is active
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-07-10 12:14:39.901855: iinla: Iteration 3 [max:10] (level 1)
#> 2024-07-10 12:14:40.266931: iinla: Step rescaling: 162%, Expand (norm0 = 20.28, norm1 = 7.397, norm01 = 12.89) (level 3)
#> 2024-07-10 12:14:40.267976: iinla: Step rescaling: 100%, Overstep (norm0 = 12.67, norm1 = 0.2191, norm01 = 12.89) (level 3)
#> 2024-07-10 12:14:40.269619: iinla: Step rescaling: 101.8%, Approx Optimisation (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 3)
#> 2024-07-10 12:14:40.270082: iinla: |lin1-lin0| = 12.89
#>        <eta-lin1,delta>/|delta| = -2.964e-05
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 0.01798 (level 4)
#> 2024-07-10 12:14:40.270493: iinla: Step rescaling: 102% (norm0 = 12.89, norm1 = 0.01798, norm01 = 12.89) (level 2)
#> 2024-07-10 12:14:40.27134: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:40.291955: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:40.305888: iinla: Max deviation from previous: 598% of SD, and line search is active
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-07-10 12:14:40.306854: iinla: Iteration 4 [max:10] (level 1)
#> 2024-07-10 12:14:40.666098: iinla: Step rescaling: 162%, Expand (norm0 = 0.02909, norm1 = 0.01111, norm01 = 0.01798) (level 3)
#> 2024-07-10 12:14:40.667162: iinla: Step rescaling: 100%, Overstep (norm0 = 0.01798, norm1 = 1.149e-07, norm01 = 0.01798) (level 3)
#> 2024-07-10 12:14:40.668752: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 0.01798, norm1 = 1.146e-07, norm01 = 0.01798) (level 3)
#> 2024-07-10 12:14:40.669257: iinla: |lin1-lin0| = 0.01798
#>        <eta-lin1,delta>/|delta| = 1.965e-10
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 1.146e-07 (level 4)
#> 2024-07-10 12:14:40.670133: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:40.684931: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:40.699177: iinla: Max deviation from previous: 10.1% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-07-10 12:14:40.70022: iinla: Iteration 5 [max:10] (level 1)
#> 2024-07-10 12:14:41.065606: iinla: Step rescaling: 162%, Expand (norm0 = 2.298e-07, norm1 = 8.778e-08, norm01 = 1.42e-07) (level 3)
#> 2024-07-10 12:14:41.066646: iinla: Step rescaling: 100%, Overstep (norm0 = 1.42e-07, norm1 = 6.789e-13, norm01 = 1.42e-07) (level 3)
#> 2024-07-10 12:14:41.068243: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 1.42e-07, norm1 = 4.682e-13, norm01 = 1.42e-07) (level 3)
#> 2024-07-10 12:14:41.068697: iinla: |lin1-lin0| = 1.42e-07
#>        <eta-lin1,delta>/|delta| = -2.069e-14
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 4.678e-13 (level 4)
#> 2024-07-10 12:14:41.069686: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:41.084548: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:41.098337: iinla: Max deviation from previous: 0.0579% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-07-10 12:14:41.098781: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode. (level 1)
#> 2024-07-10 12:14:41.099693: iinla: Iteration 6 [max:10] (level 1)
#> 2024-07-10 12:14:44.139992: iinla: Evaluate component inputs (level 3)
#> 2024-07-10 12:14:44.166202: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:44.182315: iinla: Evaluate component simplifications (level 3)
#> 2024-07-10 12:14:44.197811: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:44.20088: iinla: Construct inla stack (level 3)
#> 2024-07-10 12:14:44.218207: iinla: Model initialisation completed (level 3)
#> 2024-07-10 12:14:44.218656: iinla: Iteration 1 [max:1] (level 1)
#> 2024-07-10 12:14:44.681951: iinla: Evaluate component inputs (level 3)
#> 2024-07-10 12:14:44.719995: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:44.74969: iinla: Evaluate component simplifications (level 3)
#> 2024-07-10 12:14:44.771985: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:44.775913: iinla: Construct inla stack (level 3)
#> 2024-07-10 12:14:44.788712: iinla: Model initialisation completed (level 3)
#> 2024-07-10 12:14:44.789187: iinla: Iteration 1 [max:1] (level 1)
#> 2024-07-10 12:14:45.257435: iinla: Evaluate component inputs (level 3)
#> 2024-07-10 12:14:45.344218: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:45.382312: iinla: Evaluate component simplifications (level 3)
#> 2024-07-10 12:14:45.419493: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:45.430418: iinla: Construct inla stack (level 3)
#> 2024-07-10 12:14:45.449911: iinla: Model initialisation completed (level 3)
#> 2024-07-10 12:14:45.450377: iinla: Iteration 1 [max:10] (level 1)
#> 2024-07-10 12:14:45.853294: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 1073, norm1 = 2.645e-14, norm01 = 1073) (level 3)
#> 2024-07-10 12:14:45.853773: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2024-07-10 12:14:45.854218: iinla: |lin1-lin0| = 1073
#>        <eta-lin1,delta>/|delta| = 1.212e-15
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 4.556e-14 (level 4)
#> 2024-07-10 12:14:45.855091: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:45.892345: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:45.918789: iinla: Iteration 2 [max:10] (level 1)
#> 2024-07-10 12:14:46.324481: iinla: Step rescaling: 100%, Approx Optimisation (norm0 = 0.0008452, norm1 = 1.457e-13, norm01 = 0.0008452) (level 3)
#> 2024-07-10 12:14:46.324984: iinla: Optimisation did not improve on previous solution. (level 3)
#> 2024-07-10 12:14:46.325446: iinla: |lin1-lin0| = 0.0008452
#>        <eta-lin1,delta>/|delta| = 3.363e-16
#>        |eta-lin0 - delta <delta,eta-lin0>/<delta,delta>| = 1.457e-13 (level 4)
#> 2024-07-10 12:14:46.326312: iinla: Evaluate component linearisations (level 3)
#> 2024-07-10 12:14:46.363954: iinla: Evaluate predictor linearisation (level 3)
#> 2024-07-10 12:14:46.389917: iinla: Max deviation from previous: 0.146% of SD, and line search is inactive
#>        [stop if: <10% and line search inactive] (level 1)
#> 2024-07-10 12:14:46.390373: iinla: Convergence criterion met.
#>        Running final INLA integration step with known theta mode. (level 1)
#> 2024-07-10 12:14:46.391323: iinla: Iteration 3 [max:10] (level 1)