Skip to contents

Set pipeflow log layout

Usage

set_log_layout(layout)

Arguments

layout

Layout name

Value

invisibly returns logger object

Examples

p <- Pipeline$new("pipe", data = 1:2)
p$add("add1", \(data = ~data, x = 1) x + data)
p$run()
#> INFO  [2024-12-02 21:18:28.594] Start run of 'pipe' pipeline:
#> INFO  [2024-12-02 21:18:28.596] Step 1/2 data
#> INFO  [2024-12-02 21:18:28.597] Step 2/2 add1
#> INFO  [2024-12-02 21:18:28.599] Finished execution of steps.
#> INFO  [2024-12-02 21:18:28.599] Done.

lg <- set_log_layout("json")
print(lg)
#> <Logger> [info] pipeflow
#> 
#> appenders:
#>   [[1]]: <AppenderConsole> [all] -> console

p$run()
#> {"application":"pipeflow","level":"info","time":"2024-12-02T21:18:28+1:00","message":"Start run of 'pipe' pipeline:"}
#> {"application":"pipeflow","level":"info","time":"2024-12-02T21:18:28+1:00","message":"Step 1/2 data - skip 'done' step"}
#> {"application":"pipeflow","level":"info","time":"2024-12-02T21:18:28+1:00","message":"Step 2/2 add1 - skip 'done' step"}
#> {"application":"pipeflow","level":"info","time":"2024-12-02T21:18:28+1:00","message":"Finished execution of steps."}
#> {"application":"pipeflow","level":"info","time":"2024-12-02T21:18:28+1:00","message":"Done."}

set_log_layout("text")
p$run()
#> INFO  [2024-12-02 21:18:28.630] Start run of 'pipe' pipeline:
#> INFO  [2024-12-02 21:18:28.631] Step 1/2 data - skip 'done' step
#> INFO  [2024-12-02 21:18:28.632] Step 2/2 add1 - skip 'done' step
#> INFO  [2024-12-02 21:18:28.633] Finished execution of steps.
#> INFO  [2024-12-02 21:18:28.633] Done.