Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
qryxip committed Jan 21, 2024
1 parent 4c204db commit f00ab54
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/environment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use std::{
sync::{atomic::AtomicPtr, OnceLock}
};

use tracing::debug;

use super::{
custom_logger,
error::{Error, Result},
Expand Down
14 changes: 13 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
//! `ort` is a Rust binding for [ONNX Runtime](https://onnxruntime.ai/). For information on how to get started with `ort`,
//! see <https://ort.pyke.io/introduction>.
// `DEBUG`以下のログを封じる

macro_rules! trace {
// nop
($($_:tt)*) => {};
}

macro_rules! debug {
// nop
($($_:tt)*) => {};
}

pub(crate) mod environment;
pub(crate) mod error;
pub(crate) mod execution_providers;
Expand Down Expand Up @@ -275,7 +287,7 @@ extern_system_fn! {
);

match severity {
ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_VERBOSE => tracing::event!(parent: &span, Level::DEBUG, "{message}"),
ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_VERBOSE => tracing::event!(parent: &span, Level::DEBUG, "<hidden>"),
ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_INFO => tracing::event!(parent: &span, Level::INFO, "{message}"),
ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_WARNING => tracing::event!(parent: &span, Level::WARN, "{message}"),
ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_ERROR | ort_sys::OrtLoggingLevel::ORT_LOGGING_LEVEL_FATAL => {
Expand Down
2 changes: 1 addition & 1 deletion src/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ impl Drop for Value {
#[tracing::instrument]
fn drop(&mut self) {
let ptr = self.ptr();
tracing::trace!(
trace!(
"dropping {} value at {ptr:p}",
match &self.inner {
ValueInner::RustOwned { .. } => "rust-owned",
Expand Down

0 comments on commit f00ab54

Please sign in to comment.