Closed nalply closed 3 years ago
Solved by: log_target(flexi_logger::LogTarget::StdOut)
. Perhaps it's the terminal of vscode messing things up.
Hm, a bit strange. So far flexi_logger logs synchronously, there is no async-logging (yet). By default, flexi_logger logs to stderr, and flushes stderr before being ended. But I found that the flush was missing for stdout! You described it right the other way - could you please check once more?
Not a bug report but an end-user question:
Sometimes my program or my test seems to have ended already before all has been logged. The symptom is that sometimes the last few logging records are missing.
What should I do? Somehow get the logging thread then wait for it to end?
I tried
thread::yield_now()
,thread::sleep()
,io::stderr().lock().flush()
, etc., but sometimes records are still missing. Often an additional strategic dummyinfo!()
somewhere helps.