output: Use logdec

Description Usage Details See Also Examples

View source: R/output.R

Description

Use logdec

Usage

1

Details

logdec::output limitations

logdec::output can only be called from a standalone R file. This is because, currently, logdec recreates your R file in your temporary directory with the logdec comments replaced by the corresponding function calls (i.e. cat, cli_alert, etc.).

This means that console/interactive/package use is not possible. To mitigate this, logdec offers an extraction operator (%>>%) that will work both interactively and in package development. However, see the details on the extraction operator's page, as it is essentially a wrapper for other package functions.

See Also

%>>%

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
## Not run: 
# To start using logdec:
logdec::output()
# Make sure to call this function in the `::` syntax,
# otherwise it might not work!

# Then, add special comments, like so:
#>> This is a simple logdec message
#>> @info This is a informational logdec message
#>> @success This is a successful logdec message!
#>> @warning beware! this is a warning
#>> @danger The path ahead is DANGEROUS! :)

# logdec has `glue` support as well,
my_name <- "Justin"
#>> Hello, {my_name}!

# logdec has support for various "engines", which
# provide the functionality for your output. By
# default, logdec will use `base` commands, but
# you can use `cli` or `logger` functions as well!
options(logdec.engine = "cli")
#>> @info This is a {.fn cli::cli_alert_info} message

## End(Not run)

program--/logdec documentation built on Dec. 22, 2021, 9:53 a.m.