Skip to content

Commit

Permalink
consistent logging to enable better debugging (#1096)
Browse files Browse the repository at this point in the history
* use tracing wherever possible instead of `log`
  • Loading branch information
insipx authored Sep 30, 2024
1 parent e5bf037 commit 92e7b71
Show file tree
Hide file tree
Showing 49 changed files with 417 additions and 433 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/lint-ffi-bindings.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
name: Lint FFI Bindings

on:
push:
branches:
- main

pull_request:
paths:
- "bindings_ffi/**"
- ".github/workflows/lint-ffi-bindings.yaml"
- "rustfmt.toml"

env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
runs-on: warp-ubuntu-latest-x64-16x
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update rust toolchains
run: rustup update

- name: Cache
uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bindings_ffi
- name: Run clippy and fail on warnings
run: cargo clippy --manifest-path bindings_ffi/Cargo.toml --all-features --all-targets --no-deps -- -Dwarnings

- name: Run format check
run: cargo fmt --manifest-path bindings_ffi/Cargo.toml --check
3 changes: 2 additions & 1 deletion .github/workflows/lint-node-bindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
- "bindings_node/**"
- ".github/workflows/lint-node-bindings.yaml"
- "rustfmt.toml"

env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
- "Cargo.lock"
- "rust-toolchain"
- "rustfmt.toml"
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: Lint
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches:
- main
workflow_dispatch:

env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/test-ffi-bindings.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Test FFI Bindings

on:
push:
branches:
- main

pull_request:
# only run tests when related changes are made
paths:
Expand All @@ -21,27 +19,24 @@ on:
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain"

env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: warp-ubuntu-latest-x64-16x
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Update rust toolchains
run: rustup update

- uses: Swatinem/rust-cache@v2
with:
workspaces: |
.
bindings_ffi
- name: Start Docker containers
run: dev/up

- name: Setup Kotlin
run: |
sudo apt update -q
Expand All @@ -56,4 +51,3 @@ jobs:
run: |
export CLASSPATH="${{ env.CLASSPATH }}"
cargo nextest run --manifest-path bindings_ffi/Cargo.toml --test-threads 2
3 changes: 2 additions & 1 deletion .github/workflows/test-http-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain"
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
Expand All @@ -40,4 +42,3 @@ jobs:
uses: taiki-e/install-action@nextest
- name: Run cargo nextest on main workspace
run: cargo nextest run --workspace --exclude xmtp_api_grpc --features http-api --test-threads 2

3 changes: 2 additions & 1 deletion .github/workflows/test-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
- "Cargo.toml"
- "Cargo.lock"
- "rust-toolchain"
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
Expand All @@ -40,4 +42,3 @@ jobs:
uses: taiki-e/install-action@nextest
- name: Run cargo nextest on main workspace
run: cargo nextest run --test-threads 2

63 changes: 5 additions & 58 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ futures = "0.3.30"
futures-core = "0.3.30"
getrandom = { version = "0.2", default-features = false }
hex = "0.4.3"
log = { version = "0.4" }
openmls = { git = "https://github.com/xmtp/openmls", rev = "87e7e257d8eb15d6662b104518becfc75ef6db76", default-features = false }
openmls_basic_credential = { git = "https://github.com/xmtp/openmls", rev = "87e7e257d8eb15d6662b104518becfc75ef6db76" }
openmls_rust_crypto = { git = "https://github.com/xmtp/openmls", rev = "87e7e257d8eb15d6662b104518becfc75ef6db76" }
Expand All @@ -55,7 +54,7 @@ thiserror = "1.0"
tls_codec = "0.4.1"
tokio = { version = "1.35.1", default-features = false }
tonic = "^0.12"
tracing = { version = "0.1" }
tracing = { version = "0.1", features = ["log"] }
tracing-subscriber = "0.3"
url = "2.5.0"

Expand Down
Loading

0 comments on commit 92e7b71

Please sign in to comment.