Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make FML_LOG safe from static initialization (flutter#42219)
I ran into this while trying to get some printing going for places where we're creating thread local keys. Supposedly, just including `<iostream>` should statically initialize `std::cout/cerr`, but it gets really hard to reason about whether your statically initialized code is going to be initialized before or after that happens. I tried making sure that the TU for `fml/logging.cc` did that initialization statically, but that also failed in the verison of the test included here (it passed in some other iterations that modified run_all_unittests.cc). We _could_ make sure it happens each and every time we touch `std::cerr` but ... we could also just use `fprintf(stderr, ...)` and it works just fine. /cc @flar who ran into problems around this a little while back and was asking about it.
- Loading branch information