From f00ab54e72d4ec8050b4ed0ce66ab1df2eaa3e83 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sun, 21 Jan 2024 22:40:31 +0900 Subject: [PATCH] =?UTF-8?q?VOICEVOX/onnxruntime-rs#10=20=E3=82=92=E9=81=A9?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/environment.rs | 2 -- src/lib.rs | 14 +++++++++++++- src/value.rs | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/environment.rs b/src/environment.rs index 1373db0d..d0f72013 100644 --- a/src/environment.rs +++ b/src/environment.rs @@ -5,8 +5,6 @@ use std::{ sync::{atomic::AtomicPtr, OnceLock} }; -use tracing::debug; - use super::{ custom_logger, error::{Error, Result}, diff --git a/src/lib.rs b/src/lib.rs index dda3a676..f23a8272 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 . +// `DEBUG`以下のログを封じる + +macro_rules! trace { + // nop + ($($_:tt)*) => {}; +} + +macro_rules! debug { + // nop + ($($_:tt)*) => {}; +} + pub(crate) mod environment; pub(crate) mod error; pub(crate) mod execution_providers; @@ -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, ""), 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 => { diff --git a/src/value.rs b/src/value.rs index 51feb82b..792debd6 100644 --- a/src/value.rs +++ b/src/value.rs @@ -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",