Debian Codegraph @

inst/draft_vignettes/lgr-configs.Rmd

raw
1 ---
2 title: "Example Configurations"
3 output: rmarkdown::html_vignette
4 vignette: >
5 %\VignetteIndexEntry{lgr-simple}
6 %\VignetteEncoding{UTF-8}
7 %\VignetteEngine{knitr::rmarkdown}
8 editor_options:
9 chunk_output_type: console
10 ---
11
12 ```{r, include = FALSE}
13 knitr::opts_chunk$set(
14 collapse = TRUE,
15 comment = "",
16 echo = FALSE
17 )
18 ```
19
20 ```{r setup}
21 library(lgr)
22
23 ```
24
25 # minimal
26
27 ```{r}
28 cfg <- system.file("configs/minimal.yaml", package = "lgr")
29 cat(readLines(cfg), sep = "\n")
30
31 ```
32 ```{r}
33 print(lgr::lgr$config(cfg))
34 ```
35 ```{r}
36 lgr$info("test")
37 ```
38
39
40
41 # recommended
42
43 ```{r}
44 cfg <- system.file("configs/recommended.yaml", package = "lgr")
45 cat(readLines(cfg), sep = "\n")
46
47 ```
48
49 ```{r}
50 print(lgr::lgr$config(cfg))
51
52 ```
53 ```{r echo = TRUE, comment="#>"}
54 lgr$trace("trace messages get ignored by console appender")
55 lgr$info("test")
56
57 show_log()
58 ```
59