1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim: set ts=8 sts=4 et sw=4 tw=99: */
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
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /* Debug Logging support. */
15 * This uses prlog.h See prlog.h for environment settings for output.
16 * The module name used here is 'xpclog'. These environment settings
19 * SET NSPR_LOG_MODULES=xpclog:5
20 * SET NSPR_LOG_FILE=logfile.txt
23 * XPC_LOG_ERROR(("my comment number %d", 5)) // note the double parens
28 #define XPC_LOG_INTERNAL(number,_args) \
29 do{if (XPC_Log_Check(number)){XPC_Log_print _args;}}while (0)
31 #define XPC_LOG_ALWAYS(_args) XPC_LOG_INTERNAL(1,_args)
32 #define XPC_LOG_ERROR(_args) XPC_LOG_INTERNAL(2,_args)
33 #define XPC_LOG_WARNING(_args) XPC_LOG_INTERNAL(3,_args)
34 #define XPC_LOG_DEBUG(_args) XPC_LOG_INTERNAL(4,_args)
35 #define XPC_LOG_FLUSH() PR_LogFlush()
36 #define XPC_LOG_INDENT() XPC_Log_Indent()
37 #define XPC_LOG_OUTDENT() XPC_Log_Outdent()
38 #define XPC_LOG_CLEAR_INDENT() XPC_Log_Clear_Indent()
39 #define XPC_LOG_FINISH() XPC_Log_Finish()
43 void XPC_Log_print(const char* fmt
, ...);
44 bool XPC_Log_Check(int i
);
45 void XPC_Log_Indent();
46 void XPC_Log_Outdent();
47 void XPC_Log_Clear_Indent();
48 void XPC_Log_Finish();
54 #define XPC_LOG_ALWAYS(_args) ((void)0)
55 #define XPC_LOG_ERROR(_args) ((void)0)
56 #define XPC_LOG_WARNING(_args) ((void)0)
57 #define XPC_LOG_DEBUG(_args) ((void)0)
58 #define XPC_LOG_FLUSH() ((void)0)
59 #define XPC_LOG_INDENT() ((void)0)
60 #define XPC_LOG_OUTDENT() ((void)0)
61 #define XPC_LOG_CLEAR_INDENT() ((void)0)
62 #define XPC_LOG_FINISH() ((void)0)
65 #endif /* xpclog_h___ */