1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
8 interface nsIConsoleListener
;
9 interface nsIConsoleMessage
;
11 [scriptable
, uuid(0eb81d20
-c37e
-42d4
-82a8
-ca9ae96bdf52
)]
12 interface nsIConsoleService
: nsISupports
14 void logMessage
(in nsIConsoleMessage
message);
17 * Convenience method for logging simple messages.
19 void logStringMessage
(in wstring
message);
22 * Get an array of all the messages logged so far. If no messages
23 * are logged, this function will return a count of 0, but still
24 * will allocate one word for messages, so as to show up as a
25 * 0-length array when called from script.
27 void getMessageArray
([optional] out uint32_t count
,
28 [retval, array
, size_is(count
)] out nsIConsoleMessage messages
);
31 * To guard against stack overflows from listeners that could log
32 * messages (it's easy to do this inadvertently from listeners
33 * implemented in JavaScript), we don't call any listeners when
34 * another error is already being logged.
36 void registerListener
(in nsIConsoleListener listener
);
39 * Each registered listener should also be unregistered.
41 void unregisterListener
(in nsIConsoleListener listener
);
44 * Clear the message buffer (e.g. for privacy reasons).
51 #define NS_CONSOLESERVICE_CID \
52 { 0x7e3ff85c, 0x1dd2, 0x11b2, { 0x8d, 0x4b, 0xeb, 0x45, 0x2c, 0xb0, 0xff, 0x40 }}
54 #define NS_CONSOLESERVICE_CONTRACTID
"@mozilla.org/consoleservice;1"