phoneengine/networkhandlingstarter/inc/networkhandlingstarterlogging.h
changeset 27 2f8f8080a020
child 65 2a5d4ab426d3
equal deleted inserted replaced
22:6bb1b21d2484 27:2f8f8080a020
       
     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 NETWORKHANDLINGSTARTERSLOGGING_H
       
    19 #define NETWORKHANDLINGSTARTERSLOGGING_H
       
    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 #define MSG_OUTPUT_RDEBUG
       
    30 
       
    31 
       
    32 
       
    33 #ifdef MSG_OUTPUT_RDEBUG
       
    34 #ifdef Q_OS_SYMBIAN
       
    35 #include <e32debug.h>
       
    36 
       
    37 static void networkHandlingStarterMsgOutput(QtMsgType type, const char *msg)
       
    38 {
       
    39     switch (type) {
       
    40     
       
    41     case QtDebugMsg:
       
    42         RDebug::Printf("networkhandlingstarter Debug: %s\n", msg);
       
    43         break;
       
    44         
       
    45     case QtWarningMsg:
       
    46         RDebug::Printf("networkhandlingstarter Warning: %s\n", msg);
       
    47         break;
       
    48 
       
    49     case QtCriticalMsg:
       
    50         RDebug::Printf("networkhandlingstarter Critical: %s\n", msg);
       
    51         break;
       
    52         
       
    53     case QtFatalMsg:
       
    54         RDebug::Printf("networkhandlingstarter Fatal: %s\n", msg);
       
    55         abort();
       
    56     }
       
    57 }
       
    58 
       
    59     #define INSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(networkHandlingStarterMsgOutput)
       
    60     #define UNINSTALL_TRACE_MSG_HANDLER qInstallMsgHandler(0)
       
    61 #else //Q_OS_SYMBIAN
       
    62     #define INSTALL_TRACE_MSG_HANDLER
       
    63     #define UNINSTALL_TRACE_MSG_HANDLER
       
    64 #endif
       
    65 #else 
       
    66     #define INSTALL_TRACE_MSG_HANDLER 
       
    67     #define UNINSTALL_TRACE_MSG_HANDLER 
       
    68 #endif //MSG_OUTPUT_RDEBUG
       
    69 
       
    70 /*!
       
    71   Debug macros
       
    72   */
       
    73 #define DPRINT qDebug() << __PRETTY_FUNCTION__
       
    74 
       
    75 
       
    76 #endif // NETWORKHANDLINGSTARTERSLOGGING_H
       
    77