phoneplugins/infowidgetplugin/infowidgetprovider/inc/infowidgetlogging.h
changeset 30 ebdbd102c78a
parent 22 6bb1b21d2484
equal deleted inserted replaced
27:2f8f8080a020 30:ebdbd102c78a
    14  * Description:  
    14  * Description:  
    15  *
    15  *
    16  */
    16  */
    17 
    17 
    18 #ifndef INFOWIDGETLOGGING_H
    18 #ifndef INFOWIDGETLOGGING_H
    19 #define INFOWIDGETLOGGING
    19 #define INFOWIDGETLOGGING_H
    20 
    20 
    21 #include <QDebug>
    21 #include <QDebug>
    22 
    22 
    23 
    23 
    24 /*!
    24 /*!
    31 
    31 
    32 #ifdef MSG_OUTPUT_RDEBUG
    32 #ifdef MSG_OUTPUT_RDEBUG
    33 #ifdef Q_OS_SYMBIAN
    33 #ifdef Q_OS_SYMBIAN
    34 #include <e32debug.h>
    34 #include <e32debug.h>
    35 
    35 
    36 static void cpPhoneSettingsPluginsMsgOutput(QtMsgType type, const char *msg)
    36 static void infoWidgetMsgOutput(QtMsgType type, const char *msg)
    37 {
    37 {
    38     switch (type) {
    38     switch (type) {
    39     
    39         
    40     case QtDebugMsg:
    40     case QtDebugMsg:
    41         RDebug::Printf("InfoWidget Debug: %s\n", msg);
    41         RDebug::Printf("InfoWidget Debug: %s\n", msg);
    42         break;
    42         break;
    43         
       
    44     case QtWarningMsg:
    43     case QtWarningMsg:
    45         RDebug::Printf("InfoWidget Warning: %s\n", msg);
    44         RDebug::Printf("InfoWidget Warning: %s\n", msg);
    46         break;
    45         break;
    47 
       
    48     case QtCriticalMsg:
    46     case QtCriticalMsg:
    49         RDebug::Printf("InfoWidget Critical: %s\n", msg);
    47         RDebug::Printf("InfoWidget Critical: %s\n", msg);
    50         break;
    48         break;
    51         
       
    52     case QtFatalMsg:
    49     case QtFatalMsg:
    53         RDebug::Printf("InfoWidget Fatal: %s\n", msg);
    50         RDebug::Printf("InfoWidget Fatal: %s\n", msg);
    54         abort();
    51         abort();
    55     }
    52     }
    56 }
    53 }
    57 
    54 
    58     #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(cpPhoneSettingsPluginsMsgOutput)
    55     #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(infoWidgetMsgOutput)
    59     #define UNINSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(0)
    56     #define UNINSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(0)
    60 #endif //Q_OS_SYMBIAN
    57 #endif //Q_OS_SYMBIAN
    61 #else 
    58 #else 
    62     #define INSTALL_TRACE_MSG_HANDLER 
    59     #define INSTALL_TRACE_MSG_HANDLER 
    63     #define UNINSTALL_TRACE_MSG_HANDLER 
    60     #define UNINSTALL_TRACE_MSG_HANDLER 
    65 
    62 
    66 /*!
    63 /*!
    67   Debug macros
    64   Debug macros
    68   */
    65   */
    69 #define DPRINT qDebug() << __PRETTY_FUNCTION__
    66 #define DPRINT qDebug() << __PRETTY_FUNCTION__
    70 
    67 #define DWARNING qWarning() << __PRETTY_FUNCTION__
       
    68 #define DCRITICAL qCritical() << __PRETTY_FUNCTION__
    71 
    69 
    72 #endif // INFOWIDGETLOGGING
    70 #endif // INFOWIDGETLOGGING
    73 
    71