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
13 #error "Must #include logging.h before any IPDL-generated files or other files that #include prlog.h."
16 // Enforce logging under production builds for MOZ_MTLOG friends.
18 #define FORCE_PR_LOG 1
24 #if defined(PR_LOGGING)
33 // PR_LOGGING is on --> make useful MTLOG macros
34 #define MOZ_MTLOG_MODULE(n) \
35 static PRLogModuleInfo* getLogModule() { \
36 static PRLogModuleInfo* log; \
38 log = PR_NewLogModule(n); \
42 #define MOZ_MTLOG(level, b) \
44 std::stringstream str; \
46 PR_LOG(getLogModule(), level, ("%s", str.str().c_str())); } while(0)
49 // PR_LOGGING is off --> make no-op MTLOG macros
50 #define MOZ_MTLOG_MODULE(n)
51 #define MOZ_MTLOG(level, b)
53 #endif // defined(PR_LOGGING)