Skip to contents

Add the supplied txt and the module type to the log file and display it to the console.

Usage

FM_le(state, entry, escape_braces = TRUE, entry_type = "alert")

Arguments

state

Module state after yaml read

entry

Text to add

escape_braces

Set to TRUE (default) to escape curly braces in the entry, set to FALSE to have the values interpreted.

entry_type

Set to either "alert"(default), "danger", "info", "success", or "warning"

Value

Boolean value indicating success (TRUE) or failure (FALSE).

Examples

# We need a module state to use this function:
sess_res = UD_test_mksession()
#> → ASM: including file
#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → ASM:   dest:   file.path("config","report.docx")
#> → ASM: including file
#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → ASM:   dest:   file.path("config","report.pptx")
#> → ASM: including file
#> → ASM:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → ASM:   dest:   file.path("config","report.yaml")
#> → ASM: State initialized
#> → ASM: setting word placeholders: 
#> → ASM:   -> setting docx ph: HEADERLEFT = left header
#> → ASM:   -> setting docx ph: HEADERRIGHT = right header
#> → ASM:   -> setting docx ph: FOOTERLEFT = left footer
#> → ASM: module isgood: TRUE
#> → UD: including file
#> → UD:   source: file.path(system.file(package="onbrand"), "templates", "report.docx")
#> → UD:   dest:   file.path("config","report.docx")
#> → UD: including file
#> → UD:   source: file.path(system.file(package="onbrand"), "templates", "report.pptx")
#> → UD:   dest:   file.path("config","report.pptx")
#> → UD: including file
#> → UD:   source: file.path(system.file(package="onbrand"), "templates", "report.yaml")
#> → UD:   dest:   file.path("config","report.yaml")
#> → UD: State initialized
#> → UD: module checksum updated:897d952fecbc804999396a96f9df4b20
#> → UD: module isgood: TRUE
state   = sess_res$state
FM_le(state, "This is a normal  message")
#> → UD: This is a normal  message
#> NULL
FM_le(state, "This is a danger  message", entry_type="danger")
#>  UD: This is a danger  message
#> NULL
FM_le(state, "This is a info    message", entry_type="info")
#>  UD: This is a info    message
#> NULL
FM_le(state, "This is a success message", entry_type="success")
#>  UD: This is a success message
#> NULL
FM_le(state, "This is a warning message", entry_type="warning")
#> ! UD: This is a warning message
#> NULL