Open iesahin opened 3 years ago
The issue here is that simplelog is deadlocking when there's a re-entrant call to the log from formatting calls it makes. I cannot reproduce this issue when using env_logger, but I can recreate the same behavior with sled out of the loop. Here's the code I reproduced it with. https://gist.github.com/divergentdave/cc05fdbb61bfd6e9238d5600937628ce
Thank you @divergentdave I can use another logging implementation, and report this to simplelog if you're certain that sled runs the logging as it should be.
I'm looking for a point to put "possible interactions with other crates" section in the documentation to put this info for the short term. Where do you think is a better point?
I've replaced the logging implementation with fern, and the problem seems to persist.
This is a similar issue, turn on fern's meta-logging-in-format
feature, as seen here https://docs.rs/fern/0.6.0/fern/meta/index.html
Oh, thanks. Could you point me to the most appropriate document in the docs to summarize this? I would like to submit a PR for this.
Expected
I have a code that starts up sled in a function, like
I tried several different options but it stops at the
watch!
line.watch!
is a self made macro that runslog::trace!
with the variable name.Actual result
I have a test function like the following.
The trace stops at the
watch!
line above.When I comment out the line
the test runs as normally.
That line calls a log initialization code as the following:
sled version
From the logs, it looks sled is at
0.34.7
rustc version
operating system
Ubuntu 20.04 on WSL 2 on Windows 11
Adding a main function to the above should be enough to reproduce.
logs, panic messages, stack traces
The whole trace (that includes my trace) before freeze is this:
Thank you very much for sled. 🙏🏼