-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log before JACK library calls commence. (#208)
* Enable jack logging sooner. - Make `log` crate an optional dependency. - Write documentation for available features. * Bump version.
- Loading branch information
Showing
15 changed files
with
322 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
layout: page | ||
title: Features | ||
permalink: /features | ||
nav_order: 1 | ||
--- | ||
|
||
# Features | ||
|
||
The Rust features for the `jack` crate are defined in | ||
<https://github.com/RustAudio/rust-jack/blob/main/Cargo.toml>. To see the | ||
documentation for Rust features in general, see the [Rust | ||
Book](https://doc.rust-lang.org/cargo/reference/features.html). | ||
|
||
## Disabling Default Features | ||
|
||
The `jack` crate ships with a reasonable set of default features. To enable just | ||
a subset of features, set `default-features` to false and select only the | ||
desired features. | ||
|
||
```toml | ||
jack = { version = "..", default-features = false, features = ["log"] } | ||
``` | ||
|
||
## `log` | ||
|
||
Default: Yes | ||
|
||
If the [`log` crate](https://crates.io/crates/log) should be used to handle JACK | ||
logging. Requires setting up a logging implementation to make messages | ||
available. | ||
|
||
## `dynamic_loading` | ||
|
||
Default: Yes | ||
|
||
Load `libjack` at runtime as opposed to the standard dynamic linking. This is | ||
preferred as it allows `pw-jack` to intercept the loading at runtime to provide | ||
the Pipewire JACK server implementation. | ||
|
||
## `metadata` | ||
|
||
Default: No | ||
|
||
Provides access to the metadata API. This is experimental. Details on the JACK | ||
metadata API can be found at <https://jackaudio.org/metadata/>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
layout: page | ||
title: Logging | ||
permalink: /logging | ||
nav_order: 2 | ||
--- | ||
|
||
# Logging | ||
|
||
JACK can communicate info and error messages. By default, the [log | ||
crate](https://github.com/rust-lang/log) is hooked up to output | ||
messages. However, other logging methods can be used with the | ||
[`set_logger`](https://docs.rs/jack/latest/jack/fn.set_logger.html) function. | ||
|
||
## No Logging | ||
|
||
Logging from `jack` can be disabled entirely by setting the logger to `None`. | ||
|
||
```rust | ||
jack::set_logger(jack::LoggerType::None); | ||
``` | ||
|
||
## Log Crate (default) | ||
|
||
The log crate is the default logger if the `log` feature is enabled, which is | ||
enabled by default. The `log` crate provides a *facade* for logging; it provides | ||
macros to perform logging, but another mechanism or crate is required to | ||
actually perform the logging. | ||
|
||
In the example below, we use the [`env_logger` crate]() to display logging for | ||
info and error severity level messages. | ||
|
||
```rust | ||
env_logger::builder().filter(None, log::LevelFilter::Info).init(); | ||
|
||
// JACK may log things to `info!` or `error!`. | ||
let (client, _status) = | ||
jack::Client::new("rust_jack_simple", jack::ClientOptions::NO_START_SERVER).unwrap(); | ||
``` | ||
|
||
|
||
## Stdio | ||
|
||
If the `log` feature is not enabled, then `jack` will log info messages to | ||
`stdout` and error messages to `stderr`. These usually show up in the terminal. | ||
|
||
```rust | ||
jack::set_logger(jack::LoggerType::Stdio); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
layout: page | ||
title: Quickstart | ||
permalink: / | ||
nav_order: 0 | ||
--- | ||
|
||
# Quickstart | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.