1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 // Original author: ekr@rtfm.com
15 #if defined(PR_LOGGING)
24 // PR_LOGGING is on --> make useful MTLOG macros
25 #define MOZ_MTLOG_MODULE(n) \
26 static PRLogModuleInfo* getLogModule() { \
27 static PRLogModuleInfo* log; \
29 log = PR_NewLogModule(n); \
33 #define MOZ_MTLOG(level, b) \
35 std::stringstream str; \
37 PR_LOG(getLogModule(), level, ("%s", str.str().c_str())); } while(0)
40 // PR_LOGGING is off --> make no-op MTLOG macros
41 #define MOZ_MTLOG_MODULE(n)
42 #define MOZ_MTLOG(level, b)
43 #endif // defined(PR_LOGGING)