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

Document & refactor Stelline a bit #433

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
enabling logging module only when tracing-subscriber is enabled
tertsdiepraam committed Nov 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 41bc25d71cc2942e1e8d8b6d35c1653722de65af
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -164,7 +164,6 @@ extern crate core;

pub mod base;
pub mod dep;
mod logging;
pub mod net;
pub mod rdata;
pub mod resolv;
@@ -176,3 +175,5 @@ pub mod validate;
pub mod validator;
pub mod zonefile;
pub mod zonetree;

mod logging;
14 changes: 6 additions & 8 deletions src/logging.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
use tracing_subscriber::EnvFilter;
//! Common logging functions

/// Setup logging of events reported by domain and the test suite.
///
/// Use the RUST_LOG environment variable to override the defaults.
///
/// E.g. To enable debug level logging:
/// RUST_LOG=DEBUG
///
/// Or to log only the steps processed by the Stelline client:
/// RUST_LOG=net_server::net::stelline::client=DEBUG
///
/// Or to enable trace level logging but not for the test suite itself:
/// RUST_LOG=TRACE,net_server=OFF
/// ```
/// RUST_LOG=DEBUG

Check failure on line 9 in src/logging.rs

GitHub Actions / test (macOS-latest, nightly)

cannot find value `RUST_LOG` in this scope

Check failure on line 9 in src/logging.rs

GitHub Actions / test (macOS-latest, nightly)

cannot find value `DEBUG` in this scope

Check failure on line 9 in src/logging.rs

GitHub Actions / test (ubuntu-latest, nightly)

cannot find value `RUST_LOG` in this scope

Check failure on line 9 in src/logging.rs

GitHub Actions / test (ubuntu-latest, nightly)

cannot find value `DEBUG` in this scope

Check failure on line 9 in src/logging.rs

GitHub Actions / test (macOS-latest, 1.76.0)

cannot find value `RUST_LOG` in this scope

Check failure on line 9 in src/logging.rs

GitHub Actions / test (macOS-latest, 1.76.0)

cannot find value `DEBUG` in this scope

Check failure on line 9 in src/logging.rs

GitHub Actions / test (macOS-latest, beta)

cannot find value `RUST_LOG` in this scope

Check failure on line 9 in src/logging.rs

GitHub Actions / test (macOS-latest, beta)

cannot find value `DEBUG` in this scope

Check failure on line 9 in src/logging.rs

GitHub Actions / test (ubuntu-latest, nightly)

cannot find value `RUST_LOG` in this scope

Check failure on line 9 in src/logging.rs

GitHub Actions / test (ubuntu-latest, nightly)

cannot find value `DEBUG` in this scope
/// ```
#[cfg(feature = "tracing-subscriber")]
pub fn init_logging() {

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (stable)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (stable)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (stable)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (stable)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (beta)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (beta)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (beta)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (beta)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (1.78.0)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (1.78.0)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (1.78.0)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (1.78.0)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (nightly)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (nightly)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (nightly)

function `init_logging` is never used

Check warning on line 12 in src/logging.rs

GitHub Actions / Build examples (nightly)

function `init_logging` is never used
use tracing_subscriber::EnvFilter;
tracing_subscriber::fmt()
.with_env_filter(EnvFilter::from_default_env())
.with_thread_ids(true)

Unchanged files with check annotations Beta

A `QUERY` step sends a query to the tested program. It can optionally have data declaring its `ADDRESS` and `KEY`:
```
STEP 1 QUERY

Check failure on line 55 in src/stelline/README.md

GitHub Actions / test (macOS-latest, beta)

expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `1`
STEP 1 QUERY ADDRESS <ip_address> KEY <key_name>
```