Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dd060d29 authored by Jakub Pawlowski's avatar Jakub Pawlowski
Browse files

Do not redefine logging if already defined am: b7ea929a

Change-Id: I6828c8f46b443af245622195c51aff5dfe0da684
parents 69186c99 b7ea929a
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -28,12 +28,18 @@

#include <log/log.h>

/* When including headers from legacy stack, this log definitions collide with existing logging system. Remove once we
 * get rid of legacy stack. */
#ifndef LOG_VERBOSE

#define LOG_VERBOSE(fmt, args...) ALOGV("%s:%d %s: " fmt, __FILE__, __LINE__, __func__, ##args)
#define LOG_DEBUG(fmt, args...) ALOGD("%s:%d %s: " fmt, __FILE__, __LINE__, __func__, ##args)
#define LOG_INFO(fmt, args...) ALOGI("%s:%d %s: " fmt, __FILE__, __LINE__, __func__, ##args)
#define LOG_WARN(fmt, args...) ALOGW("%s:%d %s: " fmt, __FILE__, __LINE__, __func__, ##args)
#define LOG_ERROR(fmt, args...) ALOGE("%s:%d %s: " fmt, __FILE__, __LINE__, __func__, ##args)

#endif /* LOG_VERBOSE*/

#else

/* syslog didn't work well here since we would be redefining LOG_DEBUG. */
@@ -41,6 +47,10 @@
#include <cstdio>
#include <ctime>

/* When including headers from legacy stack, this log definitions collide with existing logging system. Remove once we
 * get rid of legacy stack. */
#ifndef LOG_VERBOSE

#define LOGWRAPPER(fmt, args...)                                                                                      \
  do {                                                                                                                \
    auto now = std::chrono::system_clock::now();                                                                      \
@@ -64,6 +74,8 @@
    abort();                  \
  } while (false)

#endif /* LOG_VERBOE */

#endif /* defined(OS_ANDROID) */

#define ASSERT(condition)                                    \