-
Notifications
You must be signed in to change notification settings - Fork 13
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
$ORT_ALLOW_VERBOSE_LOGGING_ON_RELEASE
を導入
#10
$ORT_ALLOW_VERBOSE_LOGGING_ON_RELEASE
を導入
#10
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
補足
Level::TRACE, | ||
"onnxruntime", | ||
category = category.to_str().unwrap_or("<unknown>"), | ||
file = code_location.file, | ||
line_number = code_location.line_number, | ||
function = code_location.function, | ||
logid = logid.to_str().unwrap_or("<unknown>"), | ||
); | ||
let _enter = span.enter(); | ||
let _span = cfg!(allow_verbose_logging).then(|| { | ||
span!( | ||
Level::TRACE, | ||
"onnxruntime", | ||
category = category.to_str().unwrap_or("<unknown>"), | ||
file = code_location.file, | ||
line_number = code_location.line_number, | ||
function = code_location.function, | ||
logid = logid.to_str().unwrap_or("<unknown>"), | ||
) | ||
.entered() | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これについては完全に無害だとは思うが、挙動の一貫性のためこうしておいた。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここにおける"span"は、このonnxruntime{…}
の中。
2022-12-07T14:39:09.569061Z INFO onnxruntime{category="onnxruntime" file="graph.cc" line_number="3559" function="CleanUnusedInitializersAndNodeArgs" logid=""}: onnxruntime::onnxruntime: "Removing initializer \'664\'. It is not used by any node and should be removed from the model."
2022-12-07T14:39:09.569084Z INFO onnxruntime{category="onnxruntime" file="graph.cc" line_number="3559" function="CleanUnusedInitializersAndNodeArgs" logid=""}: onnxruntime::onnxruntime: "Removing initializer \'661\'. It is not used by any node and should be removed from the model."
2022-12-07T14:39:09.569096Z INFO onnxruntime{category="onnxruntime" file="graph.cc" line_number="3559" function="CleanUnusedInitializersAndNodeArgs" logid=""}: onnxruntime::onnxruntime: "Removing initializer \'660\'. It is not used by any node and should be removed from the model."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(あとallow_debug_logging
のつもりでallow_verbose_logging
と書いていたので修正しました)
やっぱりallow_verbose_logging
の方が適切だと思ったのでそうしました。
@@ -145,6 +145,26 @@ macro_rules! extern_system_fn { | |||
($(#[$meta:meta])* $vis:vis unsafe fn $($tt:tt)*) => ($(#[$meta])* $vis unsafe extern "C" fn $($tt)*); | |||
} | |||
|
|||
// textual scopeで`trace!`と`debug!`を宣言することにより、`tracing`のそれらの`use`を封じる |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
textual scopeについての解説はこれ。
Textual Scope - Macros By Example - The Rust Reference
私も思い付きで試してみるまで知らなかったが、下のmod
やブロックにおける名前解決も邪魔できる。
$ORT_ALLOW_DEBUG_LOGGING
を導入$ORT_ALLOW_VERBOSE_LOGGING_ON_RELEASE
を導入
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!
DEBUGやINFOレベルはデバッグビルドのときでないと表示させない、という感じだと把握しました!
ありがとうございます!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This reverts commit f00ab54.
VOICEVOX/voicevox_core#338 におけるログにポインタ値等を出せてしまう問題に対し、tracingについてはDEBUG、ORT本体についてはINFO以下の出力を制限することで解決します。
(tracingとORTのログレベルの対応はこんな感じになっているのでややこしいですが)