• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

Classes | Public Member Functions | Static Public Member Functions | List of all members
KDebug Class Reference
Debug message generators

#include <kdebug.h>

Classes

class  Block
 

Public Member Functions

 KDebug (QtMsgType type, const char *f=0, int l=-1, const char *info=0)
 
QDebug operator() (int area=KDE_DEFAULT_DEBUG_AREA)
 
QDebug operator() (bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
 

Static Public Member Functions

static bool hasNullOutput (QtMsgType type, bool condition, int area, bool enableByDefault)
 
static bool hasNullOutputQtDebugMsg (int area=KDE_DEFAULT_DEBUG_AREA)
 
static bool hasNullOutputQtDebugMsg (bool condition, int area=KDE_DEFAULT_DEBUG_AREA)
 
static int registerArea (const QByteArray &areaName, bool enabled=true)
 

Detailed Description

A class for using operator()

Definition at line 243 of file kdebug.h.

Constructor & Destructor Documentation

KDebug::KDebug ( QtMsgType  type,
const char *  f = 0,
int  l = -1,
const char *  info = 0 
)
inlineexplicit

Definition at line 251 of file kdebug.h.

Member Function Documentation

bool KDebug::hasNullOutput ( QtMsgType  type,
bool  condition,
int  area,
bool  enableByDefault 
)
static

Definition at line 818 of file kdebug.cpp.

static bool KDebug::hasNullOutputQtDebugMsg ( int  area = KDE_DEFAULT_DEBUG_AREA)
inlinestatic

Definition at line 271 of file kdebug.h.

static bool KDebug::hasNullOutputQtDebugMsg ( bool  condition,
int  area = KDE_DEFAULT_DEBUG_AREA 
)
inlinestatic

Definition at line 274 of file kdebug.h.

QDebug KDebug::operator() ( int  area = KDE_DEFAULT_DEBUG_AREA)
inline

Definition at line 259 of file kdebug.h.

QDebug KDebug::operator() ( bool  cond,
int  area = KDE_DEFAULT_DEBUG_AREA 
)
inline

Definition at line 261 of file kdebug.h.

int KDebug::registerArea ( const QByteArray &  areaName,
bool  enabled = true 
)
static
Since
4.4 Register a debug area dynamically.
Parameters
areaNamethe name of the area
enabledwhether debug output should be enabled by default (users can override this in kdebugdialog or with DisableAll=true in kdebugrc)
Returns
the area code that was allocated for this area

Typical usage: If all uses of the debug area are restricted to a single class, add a method like this (e.g. into the Private class, if there's one) static int debugArea() { static int s_area = KDebug::registerArea("areaName"); return s_area; } Please do not use a file-static int, it would (indirectly) create KGlobal too early, create KConfig instances too early (breaking unittests which set KDEHOME), etc. By using a function as shown above, you make it all happen on-demand, rather than upfront.

If all uses of the debug area are restricted to a single .cpp file, do the same but outside any class, and then use a more specific name for the function.

If however multiple classes and files need the debug area, then declare it in one file without static, and use "extern int debugArea();" in other files (with a better name for the function of course).

Definition at line 856 of file kdebug.cpp.


The documentation for this class was generated from the following files:
  • kdebug.h
  • kdebug.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal