dbgsrv/coredumpserver/test/flashdump/inc/debuglogging.h
author ravikurupati
Tue, 02 Mar 2010 10:33:16 +0530
changeset 0 c6b0df440bee
permissions -rw-r--r--
Initial contribution of EPL licensed sources

// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
// Logging macros for use in debug subsystem
//



/**
 @file
 @internalTechnology
 @released
*/

#ifndef DEBUG_LOGGING_H
#define DEBUG_LOGGING_H

/* 
 * Debug messages are only generated for debug builds.
 */

#ifdef FLASHDUMPDEBUG

    #include <e32debug.h>
    #define LOG_DES(des) {if(des.Length() > 0) {RBuf buf; buf.CreateL(des); char *ptr = (char*)buf.Collapse().PtrZ(); LOG_MSG2("\n(%s)\n", ptr); buf.Close();} }

    #define LOG_MSG( a )              RDebug::Printf( a )
    #define LOG_MSG2( a, b )          RDebug::Printf( a, b )
    #define LOG_MSG3( a, b, c )       RDebug::Printf( a, b, c )
    #define LOG_MSG4( a, b, c, d )    RDebug::Printf( a, b, c, d )
    #define LOG_MSG5( a, b, c, d, e ) RDebug::Printf( a, b, c, d, e )

#else

    #define LOG_DES(des)
    #define LOG_MSG( a )
    #define LOG_MSG2( a, b )
    #define LOG_MSG3( a, b, c )
    #define LOG_MSG4( a, b, c, d )
    #define LOG_MSG5( a, b, c, d, e )

#endif

#endif //DEBUG_LOGGING_H