Skip to content

Commit 364b09a

Browse files
authored
Timestamp logging example
Added sample output
1 parent 07fcbd3 commit 364b09a

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ global_logger(transformer_logger)
321321

322322
## Add timestamp to all logging
323323

324-
```
324+
```julia
325325
using Logging, LoggingExtras, Dates
326326

327327
const date_format = "yyyy-mm-dd HH:MM:SS"
@@ -332,3 +332,12 @@ end
332332

333333
ConsoleLogger(stdout, Logging.Debug) |> timestamp_logger |> global_logger
334334
```
335+
336+
This will produce output similar to:
337+
```julia
338+
[ Info: 2019-09-20 17:43:54 /es/update 200
339+
┌ Debug: 2019-09-20 18:03:25 Recompiling stale cache file /.julia/compiled/v1.2/TranslationsController.ji for TranslationsController [top-level]
340+
└ @ Base loading.jl:1240
341+
┌ Error: 2019-09-20 17:43:54 ErrorException("SearchLight validation error(s) for Translations.Translation")
342+
└ @ TranslationsController ~/Dropbox/Projects/LiteCMS/app/resources/translations/TranslationsController.jl:69
343+
```

0 commit comments

Comments
 (0)