AOS_LOG to messages
Change-Id: I0cb78a957a180f4472fc3e78a75eade63e4e43b8
diff --git a/aos/logging/implementations.cc b/aos/logging/implementations.cc
index cfc14c0..04831a2 100644
--- a/aos/logging/implementations.cc
+++ b/aos/logging/implementations.cc
@@ -131,10 +131,6 @@
void SetImplementation(LogImplementation *implementation, bool update_global) {
internal::Context *context = internal::Context::Get();
- if (implementation == nullptr) {
- AOS_LOG(FATAL, "SetImplementation got invalid implementation");
- }
-
context->implementation = implementation;
if (update_global) {
SetGlobalImplementation(implementation);
@@ -150,6 +146,10 @@
return old;
}
+LogImplementation *GetImplementation() {
+ return internal::Context::Get()->implementation;
+}
+
void Init() {
static absl::once_flag once;
absl::call_once(once, DoInit);
@@ -264,7 +264,7 @@
void RegisterCallbackImplementation(
const ::std::function<void(const LogMessage &)> &callback,
- bool update_global = true) {
+ bool update_global) {
Init();
SetImplementation(new CallbackLogImplementation(callback), update_global);
}