Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging feature to enable optional log crate dependency #159

Merged
merged 1 commit into from
Jul 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ jobs:
command: test
args: --no-default-features --features 'future, atomic64, quanta'

- name: Run tests (future and sync features)
- name: Run tests (future, sync and logging features)
uses: actions-rs/cargo@v1
with:
command: test
args: --features 'future, sync'
args: --features 'future, sync, logging'

- name: Run tests (dash feature, but no sync feature)
uses: actions-rs/cargo@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/CIQuantaDisabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ jobs:
command: test
args: --no-default-features --features 'future, atomic64'

- name: Run tests (future feature, but no quanta feature)
- name: Run tests (future, sync and logging features, but no quanta feature)
uses: actions-rs/cargo@v1
with:
command: test
args: --no-default-features --features 'sync, future, atomic64'
args: --no-default-features --features 'sync, future, atomic64, logging'

- name: Run tests (dash feature, but no quanta and sync features)
uses: actions-rs/cargo@v1
Expand Down
8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ future = ["crossbeam-epoch", "thiserror", "uuid", "async-io", "async-lock", "fut
# few releases.
dash = ["dashmap"]

# Enable this feature to activate optional logging from caches.
# Currently cache will emit log only when it encounters a panic in user provided
# callback closure.
logging = ["log"]

# This feature is enabled by default. Disable it when the target platform does not
# support `std::sync::atomic::AtomicU64`. (e.g. `armv5te-unknown-linux-musleabi`
# or `mips-unknown-linux-musl`)
Expand Down Expand Up @@ -73,6 +78,9 @@ async-io = { version = "1.4", optional = true }
async-lock = { version = "2.4", optional = true }
futures-util = { version = "0.3", optional = true }

# Optional dependencies (logging)
log = { version = "0.4", optional = true }

[dev-dependencies]
actix-rt = { version = "2.7", default-features = false }
async-std = { version = "1.11", features = ["attributes"] }
Expand Down