Skip to content

Commit

Permalink
Merge pull request #159 from moka-rs/add-logger
Browse files Browse the repository at this point in the history
Add `logging` feature to enable optional `log` crate dependency
  • Loading branch information
tatsuya6502 authored Jul 2, 2022
2 parents 09b986c + 7911deb commit 2460cf6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
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

0 comments on commit 2460cf6

Please sign in to comment.