Ensure that logger function is always set

I700cbfbbfc45e3ae58606fc0c2a77f592f7d652a introduced a change that the
static variable `logger_function` is initialized at runtime (via the
static initializer) rather than at compile time. This actually was
unsafe because the static variable can be used "before" it is
initialized. For example, b/248162391 shows that it was used in the
context of the dynamic linker. The similar situation can happen if the
static variable is called from another static initializer (as C++
doesn't guarantee the order of static initializers).

This change fixes the issue by ensuring that `logger_function` (and
another static variable `file_logger`) is set before it is used.

Bug: 248162391
Test: Do the mixed build test as described in b/248162391#comment2
Change-Id: Ia433c756795fbe9b671517970e6cde78827e05cc
1 file changed
tree: ab8f577b5e28d807514a20c8a2a8507ee492a8ae
  1. liblog/
  2. logcat/
  3. logd/
  4. logwrapper/
  5. rust/
  6. OWNERS
  7. PREUPLOAD.cfg
  8. TEST_MAPPING