Skip to content

Commit 5c42853

Browse files
README: tweaks
1 parent f34cd12 commit 5c42853

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

R/progression_handler.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ print.progression_handler <- function(x, ...) {
290290
s <- c(s, " * configuration:")
291291
s <- c(s, sprintf(" - name: %s", sQuote(env$name %||% "<NULL>")))
292292
s <- c(s, sprintf(" - max_steps: %s", env$max_steps %||% "<NULL>"))
293-
s <- c(s, sprintf(" - enable: %g", env$enable))
293+
s <- c(s, sprintf(" - enable: %s", env$enable))
294294
s <- c(s, sprintf(" - enable_after: %g seconds", env$enable_after))
295295
s <- c(s, sprintf(" - times: %g", env$times))
296296
s <- c(s, sprintf(" - interval: %g seconds", env$interval))

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,33 @@ will present itself as sounds played at the beginning, while progressing, and at
8383

8484
It is possible to have multiple progress handlers presenting progress updates at the same time. For example, to get both visual and auditory updates, use:
8585
```r
86-
options(progressr.handlers = list(txtprogress_barhandler, beepr_handler))
86+
options(progressr.handlers = list(txtprogressbar_handler, beepr_handler))
87+
```
88+
89+
90+
### Debugging
91+
92+
To debug progress updates, use:
93+
```r
94+
> options(progressr.handlers = debug_handler)
95+
> with_progress(y <- slow_sum(1:10))
96+
[13:33:50.776] (1.033s => +0.001s) shutdown: 10/10 (+0) '' {clear=TRUE, enabled=TRUE, status=ok}
97+
[13:33:49.743] (0.000s => +0.002s) initiate: 0/10 (+0) '' {clear=TRUE, enabled=TRUE, status=}
98+
[13:33:49.847] (0.104s => +0.001s) update: 1/10 (+1) 'Added 1' {clear=TRUE, enabled=TRUE, status=}
99+
[13:33:49.950] (0.206s => +0.001s) update: 2/10 (+1) 'Added 2' {clear=TRUE, enabled=TRUE, status=}
100+
[13:33:50.052] (0.309s => +0.000s) update: 3/10 (+1) 'Added 3' {clear=TRUE, enabled=TRUE, status=}
101+
[13:33:50.154] (0.411s => +0.001s) update: 4/10 (+1) 'Added 4' {clear=TRUE, enabled=TRUE, status=}
102+
[13:33:50.257] (0.514s => +0.001s) update: 5/10 (+1) 'Added 5' {clear=TRUE, enabled=TRUE, status=}
103+
[13:33:50.361] (0.618s => +0.002s) update: 6/10 (+1) 'Added 6' {clear=TRUE, enabled=TRUE, status=}
104+
[13:33:50.464] (0.721s => +0.001s) update: 7/10 (+1) 'Added 7' {clear=TRUE, enabled=TRUE, status=}
105+
[13:33:50.567] (0.824s => +0.001s) update: 8/10 (+1) 'Added 8' {clear=TRUE, enabled=TRUE, status=}
106+
[13:33:50.670] (0.927s => +0.001s) update: 9/10 (+1) 'Added 9' {clear=TRUE, enabled=TRUE, status=}
107+
[13:33:50.773] (1.030s => +0.001s) update: 10/10 (+1) 'Added 10' {clear=TRUE, enabled=TRUE, status=}
108+
[13:33:50.774] (1.031s => +0.003s) update: 10/10 (+0) 'Added 10' {clear=TRUE, enabled=TRUE, status=}
87109
```
88110

89111
<small>
90-
(*) To set the default progress presenter in all R session, set this option in your '~/.Rprofile' file.
112+
(*) To set the default progress presenter in all R session, set this option in your `~/.Rprofile` file.
91113
</small>
92114

93115

0 commit comments

Comments
 (0)