Skip to content

Commit

Permalink
Fix logging setup in readme (#3)
Browse files Browse the repository at this point in the history
* Fix logging setup in readme

* Add runtests and package usage
  • Loading branch information
aminya authored Aug 19, 2020
1 parent c67017c commit dafbd02
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,25 @@ Utilities for working within GitHub Actions, modelled after [`actions/core`](htt

Perhaps the most common use case is to set the global logger to one compatible with GitHub Actions' log format:

### Inside the package
```
using Logging: global_logger
using GitHubActions: GitHubActionsLogger
function __init__()
# Using GitHubActions logger in CI
get(ENV, "GITHUB_ACTIONS", "false") == "true" && global_logger(GitHubActionsLogger())
end
```

### Inside the runtests
```jl
using Logging: global_logger
using GitHubActions: GitHubActionsLogger
# Using GitHubActions logger in CI
get(ENV, "GITHUB_ACTIONS", "false") == "true" && global_logger(GitHubActionsLogger())
@warn "This warning will be visible in your GitHub Actions logs!"
```



For information on the other provided functions, see the documentation.

0 comments on commit dafbd02

Please sign in to comment.