phoneplugins/infowidgetprovider/inc/infowidgetlogging.h
changeset 22 6bb1b21d2484
parent 21 92ab7f8d0eab
child 27 2f8f8080a020
equal deleted inserted replaced
21:92ab7f8d0eab 22:6bb1b21d2484
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef INFOWIDGETLOGGING_H
       
    19 #define INFOWIDGETLOGGING
       
    20 
       
    21 #include <QDebug>
       
    22 
       
    23 
       
    24 /*!
       
    25   Define MSG_OUTPUT_RDEBUG 
       
    26   for enabling RDebug prints in development tracing. 
       
    27   Shouldn't be used in release code.
       
    28   */
       
    29 #undef MSG_OUTPUT_RDEBUG
       
    30 
       
    31 
       
    32 #ifdef MSG_OUTPUT_RDEBUG
       
    33 #ifdef Q_OS_SYMBIAN
       
    34 #include <e32debug.h>
       
    35 
       
    36 static void cpPhoneSettingsPluginsMsgOutput(QtMsgType type, const char *msg)
       
    37 {
       
    38     switch (type) {
       
    39     
       
    40     case QtDebugMsg:
       
    41         RDebug::Printf("InfoWidget Debug: %s\n", msg);
       
    42         break;
       
    43         
       
    44     case QtWarningMsg:
       
    45         RDebug::Printf("InfoWidget Warning: %s\n", msg);
       
    46         break;
       
    47 
       
    48     case QtCriticalMsg:
       
    49         RDebug::Printf("InfoWidget Critical: %s\n", msg);
       
    50         break;
       
    51         
       
    52     case QtFatalMsg:
       
    53         RDebug::Printf("InfoWidget Fatal: %s\n", msg);
       
    54         abort();
       
    55     }
       
    56 }
       
    57 
       
    58     #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(cpPhoneSettingsPluginsMsgOutput)
       
    59     #define UNINSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(0)
       
    60 #endif //Q_OS_SYMBIAN
       
    61 #else 
       
    62     #define INSTALL_TRACE_MSG_HANDLER 
       
    63     #define UNINSTALL_TRACE_MSG_HANDLER 
       
    64 #endif //MSG_OUTPUT_RDEBUG
       
    65 
       
    66 /*!
       
    67   Debug macros
       
    68   */
       
    69 #define DPRINT qDebug() << __PRETTY_FUNCTION__
       
    70 
       
    71 
       
    72 #endif // INFOWIDGETLOGGING
       
    73