diff options
author | Andreas Huber <andih@google.com> | 2010-09-21 13:13:15 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2010-09-21 15:12:19 -0700 |
commit | 6e3fa444c5b3970666707bb2b6d25e2615dafe80 (patch) | |
tree | 57a080a9aec58d0b92b2d6835483a0600694caf3 /include/media | |
parent | 8217eac0a0b6d394139eefa85d5f467240427e98 (diff) | |
download | frameworks_base-6e3fa444c5b3970666707bb2b6d25e2615dafe80.zip frameworks_base-6e3fa444c5b3970666707bb2b6d25e2615dafe80.tar.gz frameworks_base-6e3fa444c5b3970666707bb2b6d25e2615dafe80.tar.bz2 |
Remove stagefright foundation's incompatible logging interface and update callsites.
Change-Id: I45fba7d60530ea0f233ac3695a97306b6dc1795c
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/stagefright/foundation/ADebug.h | 49 |
1 files changed, 12 insertions, 37 deletions
diff --git a/include/media/stagefright/foundation/ADebug.h b/include/media/stagefright/foundation/ADebug.h index 0f986a0..69021d8 100644 --- a/include/media/stagefright/foundation/ADebug.h +++ b/include/media/stagefright/foundation/ADebug.h @@ -22,45 +22,18 @@ #include <media/stagefright/foundation/ABase.h> #include <media/stagefright/foundation/AString.h> +#include <utils/Log.h> namespace android { -enum LogType { - VERBOSE, - INFO, - WARNING, - ERROR, - FATAL, -}; - -struct Logger { - Logger(LogType type); - virtual ~Logger(); - - template<class T> Logger &operator<<(const T &x) { - mMessage.append(x); - - return *this; - } - -private: - android::AString mMessage; - LogType mLogType; - - DISALLOW_EVIL_CONSTRUCTORS(Logger); -}; - -const char *LeafName(const char *s); - -#undef LOG -#define LOG(type) Logger(type) << LeafName(__FILE__) << ":" << __LINE__ << " " +#define LITERAL_TO_STRING_INTERNAL(x) #x +#define LITERAL_TO_STRING(x) LITERAL_TO_STRING_INTERNAL(x) #define CHECK(condition) \ - do { \ - if (!(condition)) { \ - LOG(FATAL) << "CHECK(" #condition ") failed."; \ - } \ - } while (false) + LOG_ALWAYS_FATAL_IF( \ + !(condition), \ + __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ + " CHECK(" #condition ") failed.") #define MAKE_COMPARATOR(suffix,op) \ template<class A, class B> \ @@ -85,8 +58,10 @@ MAKE_COMPARATOR(GT,>) do { \ AString ___res = Compare_##suffix(x, y); \ if (!___res.empty()) { \ - LOG(FATAL) << "CHECK_" #suffix "(" #x "," #y ") failed: " \ - << ___res; \ + LOG_ALWAYS_FATAL( \ + __FILE__ ":" LITERAL_TO_STRING(__LINE__) \ + " CHECK_" #suffix "( " #x "," #y ") failed: %s", \ + ___res.c_str()); \ } \ } while (false) @@ -97,7 +72,7 @@ MAKE_COMPARATOR(GT,>) #define CHECK_GE(x,y) CHECK_OP(x,y,GE,>=) #define CHECK_GT(x,y) CHECK_OP(x,y,GT,>) -#define TRESPASS() LOG(FATAL) << "Should not be here." +#define TRESPASS() LOG_ALWAYS_FATAL("Should not be here.") } // namespace android |