Skip to content

Feature Request: Capture output from other function as log messages #129

@pwwang

Description

@pwwang
func <- function() {
  print("stdout")
}

log_capture(INFO, { func() })

# INFO [2023-11-17 23:34:41] stdout
func <- function() {
  write("stdout", stdout())
  write("stderr", stderr())
}

log_capture(INFO, ERROR, { func() })

# INFO [2023-11-17 23:34:41] stdout
# ERROR [2023-11-17 23:34:41] stderr

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions