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

Commit e21252a9 authored by Sonny Sasaka's avatar Sonny Sasaka
Browse files

Make LOG_VERBOSE and LOG_DEBUG follow settings for non-Android

Currently for non OS_ANDROID, LOG_VERBOSE and LOG_DEBUG always prints
unconditionally. This patch changes them so that they use the
configuration in InitFlags.

Bug: 186492781
Tag: #floss
Test: manual - build floss, run btadapterd and observe less logs

Change-Id: If2c7c4aa47fac8a7af48ffee298735471b7f2c2f
parent 8b6eb41d
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -84,8 +84,18 @@ static_assert(LOG_TAG != nullptr, "LOG_TAG is null after header inclusion");
#define LOG_INFO(...)
#define LOG_WARN(...)
#else
#define LOG_VERBOSE(...) LOGWRAPPER(__VA_ARGS__)
#define LOG_DEBUG(...) LOGWRAPPER(__VA_ARGS__)
#define LOG_VERBOSE(fmt, args...)                                             \
  do {                                                                        \
    if (bluetooth::common::InitFlags::IsDebugLoggingEnabledForTag(LOG_TAG)) { \
      LOGWRAPPER(fmt, ##args);                                                \
    }                                                                         \
  } while (false)
#define LOG_DEBUG(fmt, args...)                                               \
  do {                                                                        \
    if (bluetooth::common::InitFlags::IsDebugLoggingEnabledForTag(LOG_TAG)) { \
      LOGWRAPPER(fmt, ##args);                                                \
    }                                                                         \
  } while (false)
#define LOG_INFO(...) LOGWRAPPER(__VA_ARGS__)
#define LOG_WARN(...) LOGWRAPPER(__VA_ARGS__)
#endif /* FUZZ_TARGET */