зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1353143 - Part 1: Explicitly include prlog.h in mtransport/logging.h. r=drno
This updates mtransport logging to explicitly include prlog.h and defines MOZ_MTLOG in terms of PR_LOG rather than MOZ_LOG when building outside of XUL.
This commit is contained in:
Родитель
2011955e49
Коммит
83eba01284
|
@ -24,7 +24,21 @@
|
|||
static mozilla::LazyLogModule log(n); \
|
||||
return static_cast<mozilla::LogModule*>(log); \
|
||||
}
|
||||
|
||||
#define MOZ_MTLOG(level, b) \
|
||||
do { \
|
||||
if (MOZ_LOG_TEST(getLogModule(), level)) { \
|
||||
std::stringstream str; \
|
||||
str << b; \
|
||||
MOZ_LOG(getLogModule(), level, ("%s", str.str().c_str())); \
|
||||
} \
|
||||
} while(0)
|
||||
#else
|
||||
// When building mtransport outside of XUL, for example in stand-alone gtests,
|
||||
// PR_Logging needs to be used instead of mozilla logging.
|
||||
|
||||
#include "prlog.h"
|
||||
|
||||
#define MOZ_MTLOG_MODULE(n) \
|
||||
static PRLogModuleInfo* getLogModule() { \
|
||||
static PRLogModuleInfo* log; \
|
||||
|
@ -32,15 +46,14 @@
|
|||
log = PR_NewLogModule(n); \
|
||||
return log; \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define MOZ_MTLOG(level, b) \
|
||||
do { \
|
||||
if (MOZ_LOG_TEST(getLogModule(), level)) { \
|
||||
std::stringstream str; \
|
||||
str << b; \
|
||||
MOZ_LOG(getLogModule(), level, ("%s", str.str().c_str())); \
|
||||
} \
|
||||
#define MOZ_MTLOG(level, b) \
|
||||
do { \
|
||||
if (PR_LOG_TEST(getLogModule(), (PRLogModuleLevel)level)) { \
|
||||
std::stringstream str; \
|
||||
str << b; \
|
||||
PR_LOG(getLogModule(), (PRLogModuleLevel)level, ("%s", str.str().c_str())); \
|
||||
} \
|
||||
} while(0)
|
||||
|
||||
#endif // MOZILLA_INTERNAL_API
|
||||
#endif // logging_h__
|
||||
|
|
Загрузка…
Ссылка в новой задаче