Skip to contents

Add a simple logging message to any function

Usage

loudly(.f)

Arguments

.f

A function to decorate

Value

A function which returns a list. The first element of the list, $result, is the result of the original function .f applied to its inputs, and the second element is a log message, $log.

Examples

loudly(sqrt)(10)
#> $result
#> [1] 3.162278
#> 
#> $log
#> [1] "Log start..."                                                              
#> [2] "✔ sqrt(10) started at 2022-03-16 21:11:53 and ended at 2022-03-16 21:11:53"
#>