kerneltest/f32test/shostmassstorage/msman/shared/tmslog.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 31 Mar 2010 23:38:45 +0300
branchRCL_3
changeset 22 2f92ad2dc5db
parent 0 a41df078684a
permissions -rw-r--r--
Revision: 201013 Kit: 201013

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "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:
* @file tmslog.h
* 
*
*/






#ifndef TMSLOG_H
#define TMSLOG_H

//#define _TESTAPP_DEBUG_PRINT_

#if (defined(_DEBUG) || defined(_DEBUG_RELEASE))
#include <e32debug.h>
#endif

#if defined(_TESTAPP_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
#define TRACE_ENABLED
#endif

#ifdef TRACE_ENABLED

class TMsLogStaticFn
    {
public:
    static const TInt KLogBufferSize = 0xFF;

    TMsLogStaticFn(const TDesC8& aFunctionName);

	~TMsLogStaticFn();

protected:
    TBuf8<KLogBufferSize> buf;
	TPtrC8 iFunctionName;
    };




class TMsLogFn
    {
public:
    static const TInt KLogBufferSize = 0xFF;
	TMsLogFn(const TDesC8& aFunctionName, void* aThisPointer);

	~TMsLogFn();

private:
    TBuf8<KLogBufferSize> buf;
	TPtrC8 iFunctionName;
	void* iThisPointer;
    };




#define __MSFNLOG TMsLogFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__), this);
#define __MSFNSLOG TMsLogStaticFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__));
#else
#define __MSFNSLOG
#define __MSFNLOG
#endif



#ifdef TRACE_ENABLED
#define __PRINT(t) {RDebug::Print(t);}
#define __PRINT1(t,a) {RDebug::Print(t,a);}
#define __PRINT2(t,a,b) {RDebug::Print(t,a,b);}
#define __PRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
#else
#define __PRINT(t)
#define __PRINT1(t,a)
#define __PRINT2(t,a,b)
#define __PRINT3(t,a,b,c)

#endif


#endif // TMSLOG_H