Wine HQ

  WineHQ Menu
 WineHQ
 AppDB
 Bugzilla
 Wine Wiki
 Wine Forums

  About
 Introduction
 Features
 Screenshots
 Contributing
 News
 Press
 License

  Download
 Get Wine Now

  Support
 Getting Help
 FAQ
 Documentation
 HowTo
 Live Support Chat
 Paid Support

  Development
 Developers Guide
 Mailing Lists
 GIT
 Sending Patches
 To Do Lists
 Fun Projects
 Janitorial
 Winelib
 Status
 Resources
 WineConf

Search WineHQ
Debugging channels

2.2. Debugging channels

Each component is assigned a debugging channel. The identifier of the channel must be a valid C identifier (reserved word like int or static are premitted). To use a new channel, simply use it in your code. It will be picked up automatically by the build process.

Typically, a file contains code pertaining to only one component, and as such, there is only one channel to output to. You can declare a default chanel for the file using the WINE_DEFAULT_DEBUG_CHANNEL() macro:

#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(xxx);
...

    FIXME("some unimplemented feature", ...);
...
    if (zero != 0)
        ERR("This should never be non-null: %d", zero);
...
        

In rare situations there is a need to output to more than one debug channel per file. In such cases, you need to declare all the additional channels at the top of the file, and use the _-version of the debugging macros:

#include "wine/debug.h"

WINE_DEFAULT_DEBUG_CHANNEL(xxx);
WINE_DECLARE_DEBUG_CHANNEL(yyy);
WINE_DECLARE_DEBUG_CHANNEL(zzz);
...

    FIXME("this one goes to xxx channel");
...
    FIXME_(yyy)("Some other msg for the yyy channel");
...
    WARN_(zzz)("And yet another msg on another channel!");
...