libjingle includes C++ code that can be compiled and run on two main target operating systems: Linux and Windows.
libjingle includes code to enable message logging to an output stream.
The code that specifies whether or not logging is enabled is in logging.h.
If LOGGING is defined in the code, libjingle will enable
the logging macros defined in that file, including LOG, PLOG, and LOG_ERR.
(The Visual Studio solution defines _DEBUG, which causes
the code to define LOGGING; in other environments, the md_common
file defines LOGGING). libjingle code logs various messages
and errors as it works.
Logging is enabled by default in the debug build. The default logging level in debug builds is LS_INFO.
In addition, XmppClient exposes two signals, SignalLogInput and SignalLogOutput, which can be used to log incoming and outgoing XMPP stanzas. See pcp_main.cc for an example of how to listen for those two signals and use the output to display stanzas as they arrive or are sent.
The sample code sends messages to stdout. You can change
the standard output stream by calling LogMessage::LogToStream.
You can set the minimum severity message to log by calling LogMessage::LogToDebug (the
default value when logging is enabled is all messages).
This section and the following sections describe all the high level actions that a program must take in order to use libjingle functionality. If you want to customize the libjingle code to handle different stream types, or to perform different actions, you should learn more about the underlying system by reading Generic libjingle Applications, Voice Chat Applications, and File Sharing Applications, and also read Scenarios to learn about different ways that you can modify the code.
The sample applications have a main() function that starts the sign in process, and a top-level managing class that handles all the other steps. In the file share example, the handler is FileShareClient, which is defined in pcp_main.cc; in the voice chat example, the handler is CallClient, which is defined in callclient.h/.cc. The steps detailed below are the high level steps; you might only see or need to modify some of these steps, depending on how much of the code you want to reuse.
For an application to use libjingle, it must perform following steps: