File tree Expand file tree Collapse file tree 2 files changed +32
-5
lines changed Expand file tree Collapse file tree 2 files changed +32
-5
lines changed Original file line number Diff line number Diff line change 11name = " TerminalLoggers"
22uuid = " 5d786b92-1e48-4d6f-9151-6b4477ca9bed"
33authors = [
" Chris Foster <[email protected] >" ]
4- version = " 0.1.0 "
4+ version = " 0.1.1 "
55
66[deps ]
77LeftChildRightSiblingTrees = " 1d6d02ad-be62-4b6b-8a6d-2f90e265016e"
Original file line number Diff line number Diff line change @@ -27,21 +27,45 @@ atreplinit() do repl
2727end
2828```
2929
30+ ## Markdown
31+
32+ ` TerminalLogger ` interprets all ` AbstractString ` log messages as markdown so
33+ you can use markdown formatting to display readable formatted messages. For
34+ example,
35+
36+ ```
37+ @info """
38+ # A heading
39+
40+ About to do the following
41+
42+ * A list
43+ * Of actions
44+ * To take
45+ """
46+ ```
3047
3148## Progress bars
3249
3350` TerminalLogger ` displays progress logging as a set of progress bars which are
3451cleanly separated from the rest of the program output at the bottom of the
35- terminal. Try an example like the following
52+ terminal.
53+
54+ For robust progress logging, ` TerminalLoggers ` recognizes the ` Progress ` type
55+ from the [ ` ProgressLogging ` package] ( https://junolab.org/ProgressLogging.jl/stable/ ) .
56+ For easy to use progress reporting you can therefore use the ` @progress ` macro:
3657
3758``` julia
3859global_logger (TerminalLogger (right_justify= 120 ))
39- for i= 1 : 100
60+ using ProgressLogging
61+
62+ @progress for i= 1 : 100
4063 if i == 50
41- @warn " Middle of computation" i
64+ @info " Middle of computation" i
65+ elseif i == 70
66+ println (" Normal output does not interfere with progress bars" )
4267 end
4368 sleep (0.01 )
44- @info " Some progress" progress= i/ 100
4569end
4670@info " Done"
4771```
5276 We expect this will eventually be solved with some combination of libuv
5377 updates and the new windows terminal.
5478
79+ You can also use the older progress logging API with the ` progress=fraction `
80+ key value pair. This is simpler but has some downsides such as not interacting
81+ correctly with exceptions.
5582
5683## API Reference
5784
You can’t perform that action at this time.
0 commit comments