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

Custom logger for onnx runtime #21

Merged
merged 4 commits into from
Aug 27, 2020
Merged

Conversation

nbigaouette
Copy link
Owner

@nbigaouette nbigaouette commented Aug 27, 2020

Use CreateEnvWithCustomLogger() instead of CreateEnv() when creating environment as to pass a custom logger.

This allows logging on the Rust side through the tracing crate.

NOTE: The logid is initially empty even though I was expecting it to always contain the environment name (Environment::builder().with_name("test")). At some point it starts to contain the proper environment name. Maybe a bug in the runtime?

For example:

[...]
Aug 26 21:56:29.624 DEBUG onnxruntime{category="onnxruntime" file="sequential_executor.cc" line_number="150" function="Execute" logid=""}: onnxruntime::onnxruntime: "Begin execution"
Aug 26 21:56:29.625 DEBUG onnxruntime{category="onnxruntime" file="bfc_arena.cc" line_number="263" function="AllocateRawInternal" logid="test"}: onnxruntime::onnxruntime: "Extending BFCArena for Cpu. bin_num:13 rounded_bytes:3154176"
[...]

@codecov-commenter
Copy link

codecov-commenter commented Aug 27, 2020

Codecov Report

Merging #21 into master will decrease coverage by 0.81%.
The diff coverage is 13.95%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #21      +/-   ##
==========================================
- Coverage   21.09%   20.27%   -0.82%     
==========================================
  Files          17       17              
  Lines         531      572      +41     
==========================================
+ Hits          112      116       +4     
- Misses        419      456      +37     
Impacted Files Coverage Δ
onnxruntime/src/lib.rs 23.52% <0.00%> (-47.06%) ⬇️
onnxruntime/src/environment.rs 81.35% <66.66%> (-3.26%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2de308e...65a0f15. Read the comment docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants