Move SetLogger and SetAborter from libbase to liblog
libbase is copied into each APEX module which requires it, meaning that there may be multiple instances of libbase running within a single process with their own copy of libbase's globals. This means that SetLogger() and SetAborter() will only impact logs from the instance of libbase that calls it. This change moves this state to liblog, since it will only ever have one instance in a single process. One major side-effect here is that now both ALOGE style and LOG(...) style logs will be handled through the same logger function. For example, a logger specified through libbase's SetLogger() will now see logs sent to liblog through ALOGE(). This is intended behavior. A second side-effect is that libbase's stderr logger is used for all host logging now. It's simply a better logging default than the fake_log_device logger in liblog currently and makes ALOGE and LOG(...) logs on host follow the same format. Bug: 119867234 Test: libbase and liblog unit tests; logging works Change-Id: Ib52cbfb4e43749e50910ed19a993dffae19ace86
Loading
Please register or sign in to comment