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 1
1
name = " TerminalLoggers"
2
2
uuid = " 5d786b92-1e48-4d6f-9151-6b4477ca9bed"
3
3
authors = [
" Chris Foster <[email protected] >" ]
4
- version = " 0.1.0 "
4
+ version = " 0.1.1 "
5
5
6
6
[deps ]
7
7
LeftChildRightSiblingTrees = " 1d6d02ad-be62-4b6b-8a6d-2f90e265016e"
Original file line number Diff line number Diff line change @@ -27,21 +27,45 @@ atreplinit() do repl
27
27
end
28
28
```
29
29
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
+ ```
30
47
31
48
## Progress bars
32
49
33
50
` TerminalLogger ` displays progress logging as a set of progress bars which are
34
51
cleanly 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:
36
57
37
58
``` julia
38
59
global_logger (TerminalLogger (right_justify= 120 ))
39
- for i= 1 : 100
60
+ using ProgressLogging
61
+
62
+ @progress for i= 1 : 100
40
63
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" )
42
67
end
43
68
sleep (0.01 )
44
- @info " Some progress" progress= i/ 100
45
69
end
46
70
@info " Done"
47
71
```
52
76
We expect this will eventually be solved with some combination of libuv
53
77
updates and the new windows terminal.
54
78
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.
55
82
56
83
## API Reference
57
84
You can’t perform that action at this time.
0 commit comments