Skip to content

Commit be2e4cb

Browse files
authored
Merge pull request #51 from fredrikekre/fe/README
Fix example of DatetimeRotatingFileLogger in README.
2 parents 7e616f7 + ecbfebf commit be2e4cb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,18 @@ escape them so they are not interpreted by the `DateFormat` code. Example:
300300
```julia
301301
julia> using LoggingExtras
302302

303-
julia> rotating_logger = DatetimeRotatingFileLogger(pwd(), raw"\a\c\c\e\s\s-YYYY-mm-dd-HH-MM-SS.\l\o\g");
303+
julia> rotating_logger = DatetimeRotatingFileLogger(pwd(), raw"\a\c\c\e\s\s-YYYY-mm-dd-HH-MM.\l\o\g");
304304

305305
julia> with_logger(rotating_logger) do
306306
@info("This goes in one file")
307-
sleep(1.1)
307+
sleep(61) # Sleep until next minute
308308
@info("This goes in another file")
309309
end
310310

311311
julia> filter(f -> endswith(f, ".log"), readdir(pwd()))
312312
2-element Array{String,1}:
313-
"access-2020-07-13-13-24-13.log"
314-
"access-2020-07-13-13-24-14.log"
313+
"access-2020-07-13-13-24.log"
314+
"access-2020-07-13-13-25.log"
315315
```
316316
317317
The user implicitly controls when the files will be rolled over based on the `DateFormat` given.

0 commit comments

Comments
 (0)