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: // sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalTechnology sl@0: */ sl@0: sl@0: #ifndef DEBUG_H sl@0: #define DEBUG_H sl@0: sl@0: sl@0: #include sl@0: sl@0: //#define _USBMS_DEBUG_PRINT_ sl@0: //#define _SCSI_DEBUG_PRINT_ sl@0: //#define _BOT_DEBUG_PRINT_ sl@0: //#define _CLIENT_DEBUG_PRINT_ sl@0: //#define _TESTREPORT_PRINT_ sl@0: #define _TESTMODE_PRINT_ sl@0: sl@0: #if (defined(_DEBUG) || defined(_DEBUG_RELEASE)) sl@0: #include sl@0: #endif sl@0: sl@0: #if defined(_USBMS_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE)) 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: #define __PRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);} sl@0: #define __PRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);} sl@0: #define __PRINT8BIT1(t,a) {TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);} sl@0: #define __PRINT1TEMP(t,a) {TBuftemp(a);RDebug::Print(t,&temp);} sl@0: #define __PRINTERR(txt, err) {if(KErrNone != err) __PRINT1(txt, err);} sl@0: sl@0: _LIT(KMsgIn, ">>%S\n"); sl@0: _LIT(KMsgOut,"<<%S\n"); sl@0: sl@0: class TMSLogFn sl@0: { sl@0: protected: sl@0: TBuf<100> iName; sl@0: sl@0: public: sl@0: TMSLogFn(const TDesC& aName){iName = aName; RDebug::Print(KMsgIn, &iName);}; sl@0: ~TMSLogFn(){RDebug::Print(KMsgOut, &iName);}; sl@0: }; sl@0: sl@0: #define __FNLOG(name) TMSLogFn __fn_log__(_L(name)) sl@0: 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: #define __PRINT4(t,a,b,c,d) sl@0: #define __PRINT5(t,a,b,c,d,e) sl@0: #define __PRINT8BIT1(t,a) sl@0: #define __PRINT1TEMP(t,a) sl@0: #define __PRINTERR(txt,err) sl@0: #define __FNLOG(name) sl@0: #endif sl@0: sl@0: sl@0: #if defined(_SCSI_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE)) sl@0: #define __SCSIPRINT(t) {RDebug::Print(t);} sl@0: #define __SCSIPRINT1(t,a) {RDebug::Print(t,a);} sl@0: #define __SCSIPRINT2(t,a,b) {RDebug::Print(t,a,b);} sl@0: #define __SCSIPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);} sl@0: #define __SCSIPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);} sl@0: #define __SCSIPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);} sl@0: #else sl@0: #define __SCSIPRINT(t) sl@0: #define __SCSIPRINT1(t,a) sl@0: #define __SCSIPRINT2(t,a,b) sl@0: #define __SCSIPRINT3(t,a,b,c) sl@0: #define __SCSIPRINT4(t,a,b,c,d) sl@0: #define __SCSIPRINT5(t,a,b,c,d,e) sl@0: #endif sl@0: sl@0: sl@0: #if defined(_BOT_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE)) sl@0: #define __BOTPRINT(t) {RDebug::Print(t);} sl@0: #define __BOTPRINT1(t,a) {RDebug::Print(t,a);} sl@0: #define __BOTPRINT2(t,a,b) {RDebug::Print(t,a,b);} sl@0: #define __BOTPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);} sl@0: #define __BOTPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);} sl@0: #define __BOTPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);} sl@0: #else sl@0: #define __BOTPRINT(t) sl@0: #define __BOTPRINT1(t,a) sl@0: #define __BOTPRINT2(t,a,b) sl@0: #define __BOTPRINT3(t,a,b,c) sl@0: #define __BOTPRINT4(t,a,b,c,d) sl@0: #define __BOTPRINT5(t,a,b,c,d,e) sl@0: #endif sl@0: sl@0: sl@0: #if defined(_CLIENT_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE)) sl@0: #define __CLIENTPRINT(t) {RDebug::Print(t);} sl@0: #define __CLIENTPRINT1(t,a) {RDebug::Print(t,a);} sl@0: #define __CLIENTPRINT2(t,a,b) {RDebug::Print(t,a,b);} sl@0: #define __CLIENTPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);} sl@0: #define __CLIENTPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);} sl@0: #define __CLIENTPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);} sl@0: #else sl@0: #define __CLIENTPRINT(t) sl@0: #define __CLIENTPRINT1(t,a) sl@0: #define __CLIENTPRINT2(t,a,b) sl@0: #define __CLIENTPRINT3(t,a,b,c) sl@0: #define __CLIENTPRINT4(t,a,b,c,d) sl@0: #define __CLIENTPRINT5(t,a,b,c,d,e) sl@0: #endif sl@0: sl@0: sl@0: #if defined(_TESTREPORT_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE)) sl@0: #define __TESTREPORT(t) {RDebug::Print(t);} sl@0: #define __TESTREPORT1(t,a) {RDebug::Print(t,a);} sl@0: #define __TESTREPORT2(t,a,b) {RDebug::Print(t,a,b);} sl@0: #define __TESTREPORT3(t,a,b,c) {RDebug::Print(t,a,b,c);} sl@0: #define __TESTREPORT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);} sl@0: #define __TESTREPORT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);} sl@0: #else sl@0: #define __TESTREPORT(t) sl@0: #define __TESTREPORT1(t,a) sl@0: #define __TESTREPORT2(t,a,b) sl@0: #define __TESTREPORT3(t,a,b,c) sl@0: #define __TESTREPORT4(t,a,b,c,d) sl@0: #define __TESTREPORT5(t,a,b,c,d,e) sl@0: #endif sl@0: sl@0: sl@0: #if defined(_TESTMODE_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE)) sl@0: #define PREFIX(aMsg) TPtrC( (const TText*)L"[TM]: " L##aMsg ) sl@0: sl@0: #define __TESTMODEPRINT(t) {RDebug::Print(PREFIX(t));} sl@0: #define __TESTMODEPRINT1(t,a) {RDebug::Print(PREFIX(t),a);} sl@0: #define __TESTMODEPRINT2(t,a,b) {RDebug::Print(PREFIX(t),a,b);} sl@0: #define __TESTMODEPRINT3(t,a,b,c) {RDebug::Print(PREFIX(t),a,b,c);} sl@0: #define __TESTMODEPRINT4(t,a,b,c,d) {RDebug::Print(PREFIX(t),a,b,c,d);} sl@0: #define __TESTMODEPRINT5(t,a,b,c,d,e) {RDebug::Print(PREFIX(t),a,b,c,d,e);} sl@0: #else sl@0: #define __TESTMODEPRINT(t) sl@0: #define __TESTMODEPRINT1(t,a) sl@0: #define __TESTMODEPRINT2(t,a,b) sl@0: #define __TESTMODEPRINT3(t,a,b,c) sl@0: #define __TESTMODEPRINT4(t,a,b,c,d) sl@0: #define __TESTMODEPRINT5(t,a,b,c,d,e) sl@0: #endif sl@0: sl@0: #endif // DEBUG_H