Writes an informational message to the log. Message will be written to the log at the point the function is called.
Arguments
- msg
The message to log. The message must be a character string.
- console
Whether or not to print to the console. Valid values are TRUE and FALSE. Default is TRUE.
- blank_after
Whether or not to print a blank line following the printed message. The blank line helps readability of the log. Valid values are TRUE and FALSE. Default is TRUE.
- hide_notes
If notes are on, this parameter gives you the option of not printing notes for a particular log entry. Default is FALSE, meaning notes will be displayed. Used internally.
See also
log_warning to write a warning message to the log.
Examples
library(logr)
# Create temp file location
tmp <- file.path(tempdir(), "test.log")
# Open log
lf <- log_open(tmp)
# Send info to log
log_info("Here is an info message")
#> Info: Here is an info message
# Close log
log_close()
# View results
writeLines(readLines(lf))
#> =========================================================================
#> Log Path: /tmp/RtmpI4bEze/log/test.log
#> Working Directory: /tmp/.tmpGy5KKX/docs/logr/1.4.1/src/docs/reference
#> User Name: runner
#> R Version: 4.6.2 (2026-10-29)
#> Machine: runnervm48cm3 x86_64
#> Operating System: Linux 7.0.0-1017-azure #17~24.04.1-Ubuntu SMP PREEMPT Thu Sep 24 18:46:57 UTC 2026
#> Base Packages: stats graphics grDevices utils datasets methods base
#> Other Packages: logr_1.4.1 common_1.1.5
#> Log Start Time: 2026-10-29 23:26:59.967829
#> =========================================================================
#>
#> Info: Here is an info message
#>
#> NOTE: Log Print Time: 2026-10-29 23:26:59.969808
#> NOTE: Elapsed Time: 0.00145483016967773 secs
#>
#> =========================================================================
#> Log End Time: 2026-10-29 23:26:59.970928
#> Log Elapsed Time: 0 00:00:00
#> =========================================================================
