sl@0: /* sl@0: * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * @file tmslog.h sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: sl@0: #ifndef TMSLOG_H sl@0: #define TMSLOG_H sl@0: sl@0: //#define _TESTAPP_DEBUG_PRINT_ sl@0: sl@0: #if (defined(_DEBUG) || defined(_DEBUG_RELEASE)) sl@0: #include sl@0: #endif sl@0: sl@0: #if defined(_TESTAPP_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE)) sl@0: #define TRACE_ENABLED sl@0: #endif sl@0: sl@0: #ifdef TRACE_ENABLED sl@0: sl@0: class TMsLogStaticFn sl@0: { sl@0: public: sl@0: static const TInt KLogBufferSize = 0xFF; sl@0: sl@0: TMsLogStaticFn(const TDesC8& aFunctionName); sl@0: sl@0: ~TMsLogStaticFn(); sl@0: sl@0: protected: sl@0: TBuf8 buf; sl@0: TPtrC8 iFunctionName; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: class TMsLogFn sl@0: { sl@0: public: sl@0: static const TInt KLogBufferSize = 0xFF; sl@0: TMsLogFn(const TDesC8& aFunctionName, void* aThisPointer); sl@0: sl@0: ~TMsLogFn(); sl@0: sl@0: private: sl@0: TBuf8 buf; sl@0: TPtrC8 iFunctionName; sl@0: void* iThisPointer; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: #define __MSFNLOG TMsLogFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__), this); sl@0: #define __MSFNSLOG TMsLogStaticFn funcLog(TPtrC8((TUint8*)__PRETTY_FUNCTION__)); sl@0: #else sl@0: #define __MSFNSLOG sl@0: #define __MSFNLOG sl@0: #endif sl@0: sl@0: sl@0: sl@0: #ifdef TRACE_ENABLED sl@0: #define __PRINT(t) {RDebug::Print(t);} sl@0: #define __PRINT1(t,a) {RDebug::Print(t,a);} sl@0: #define __PRINT2(t,a,b) {RDebug::Print(t,a,b);} sl@0: #define __PRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);} sl@0: #else sl@0: #define __PRINT(t) sl@0: #define __PRINT1(t,a) sl@0: #define __PRINT2(t,a,b) sl@0: #define __PRINT3(t,a,b,c) sl@0: sl@0: #endif sl@0: sl@0: sl@0: #endif // TMSLOG_H