Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions R/color.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#' @param msg String to color.
#' @param level see [log_levels()]
#' @return A string with ANSI escape codes.
#' @keywords internal
#' @export
#' @examplesIf requireNamespace("crayon")
#' cat(colorize_by_log_level("foobar", FATAL), "\n")
Expand Down
1 change: 1 addition & 0 deletions R/logger.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#' function), and a list of `handlers` with the `formatter`,
#' `layout` and `appender` functions.
#' @export
#' @keywords internal
#' @references For more details, see the Anatomy of a Log Request
#' vignette at
#' <https://daroczig.github.io/logger/articles/anatomy.html>.
Expand Down
5 changes: 5 additions & 0 deletions R/try.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#' Try to evaluate an expressions and evaluate another expression on
#' exception
#'
#' We do not recommend using this function in new code; it only exported
#' for historical reasons.
#'
#' @param try R expression
#' @param except fallback R expression to be evaluated if `try` fails
#' @keywords internal
#' @export
#' @note Suppress log messages in the `except` namespace if you don't
#' want to throw a `WARN` log message on the exception branch.
Expand Down
13 changes: 9 additions & 4 deletions R/utils.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#' Check if R package can be loaded and fails loudly otherwise
#'
#' We do not recommend using this function in new code; it only exported
#' for historical reasons.
#'
#' @param pkg string
#' @param min_version optional minimum version needed
#' @export
#' @importFrom utils packageVersion compareVersion
#' @keywords internal
#' @examples \dontrun{
#' f <- function() fail_on_missing_package("foobar")
#' f()
Expand Down Expand Up @@ -48,12 +53,12 @@ top_env_name <- function(.topenv = parent.frame()) {

#' Deparse and join all lines into a single line
#'
#' Calling `deparse` and joining all the returned lines into a
#' single line, separated by whitespace, and then cleaning up all the
#' duplicated whitespace (except for excessive whitespace in strings
#' between single or double quotes).
#' We do not recommend using this function in new code; it only exported
#' for historical reasons.
#'
#' @param x object to `deparse`
#' @return string
#' @keywords internal
#' @export
deparse_to_one_line <- function(x) {
gsub('\\s+(?=(?:[^\\\'"]*[\\\'"][^\\\'"]*[\\\'"])*[^\\\'"]*$)', " ",
Expand Down
10 changes: 1 addition & 9 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,10 @@ reference:
- log_warnings
- log_errors

- title: Other helpers
contents:
- colorize_by_log_level
- logger
- delete_logger_index
- "%except%"

- title: Dev tools
contents:
- as.loglevel
- deparse_to_one_line
- fail_on_missing_package
- get_logger_meta_variables
- log_namespaces
- log_indices
- delete_logger_index
1 change: 1 addition & 0 deletions man/colorize_by_log_level.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions man/deparse_to_one_line.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/fail_on_missing_package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions man/grapes-except-grapes.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/logger.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.