Skip to content

Commit

Permalink
Update docs + bump version to 0.1.1 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
c42f authored Mar 2, 2020
1 parent a7ee26e commit 2d46dd3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "TerminalLoggers"
uuid = "5d786b92-1e48-4d6f-9151-6b4477ca9bed"
authors = ["Chris Foster <[email protected]>"]
version = "0.1.0"
version = "0.1.1"

[deps]
LeftChildRightSiblingTrees = "1d6d02ad-be62-4b6b-8a6d-2f90e265016e"
Expand Down
35 changes: 31 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,45 @@ atreplinit() do repl
end
```

## Markdown

`TerminalLogger` interprets all `AbstractString` log messages as markdown so
you can use markdown formatting to display readable formatted messages. For
example,

```
@info """
# A heading
About to do the following
* A list
* Of actions
* To take
"""
```

## Progress bars

`TerminalLogger` displays progress logging as a set of progress bars which are
cleanly separated from the rest of the program output at the bottom of the
terminal. Try an example like the following
terminal.

For robust progress logging, `TerminalLoggers` recognizes the `Progress` type
from the [`ProgressLogging` package](https://junolab.org/ProgressLogging.jl/stable/).
For easy to use progress reporting you can therefore use the `@progress` macro:

```julia
global_logger(TerminalLogger(right_justify=120))
for i=1:100
using ProgressLogging

@progress for i=1:100
if i == 50
@warn "Middle of computation" i
@info "Middle of computation" i
elseif i == 70
println("Normal output does not interfere with progress bars")
end
sleep(0.01)
@info "Some progress" progress=i/100
end
@info "Done"
```
Expand All @@ -52,6 +76,9 @@ end
We expect this will eventually be solved with some combination of libuv
updates and the new windows terminal.

You can also use the older progress logging API with the `progress=fraction`
key value pair. This is simpler but has some downsides such as not interacting
correctly with exceptions.

## API Reference

Expand Down

2 comments on commit 2d46dd3

@c42f
Copy link
Member Author

@c42f c42f commented on 2d46dd3 Mar 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/10382

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.1 -m "<description of version>" 2d46dd32289a92a201bd831cf57b8cf0b5a9379a
git push origin v0.1.1

Please sign in to comment.