os/kernelhwsrv/kerneltest/f32test/shostmassstorage/testclient/usbtestmsclient/inc/debug.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
sl@0
    17
sl@0
    18
/**
sl@0
    19
 @file
sl@0
    20
 @internalTechnology
sl@0
    21
*/
sl@0
    22
sl@0
    23
#ifndef DEBUG_H
sl@0
    24
#define DEBUG_H
sl@0
    25
sl@0
    26
sl@0
    27
#include <e32debug.h>
sl@0
    28
sl@0
    29
//#define _USBMS_DEBUG_PRINT_
sl@0
    30
//#define _SCSI_DEBUG_PRINT_
sl@0
    31
//#define _BOT_DEBUG_PRINT_
sl@0
    32
//#define _CLIENT_DEBUG_PRINT_
sl@0
    33
//#define _TESTREPORT_PRINT_
sl@0
    34
#define _TESTMODE_PRINT_
sl@0
    35
sl@0
    36
#if (defined(_DEBUG) || defined(_DEBUG_RELEASE))
sl@0
    37
#include <e32debug.h>
sl@0
    38
#endif
sl@0
    39
sl@0
    40
#if defined(_USBMS_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
sl@0
    41
#define __PRINT(t) {RDebug::Print(t);}
sl@0
    42
#define __PRINT1(t,a) {RDebug::Print(t,a);}
sl@0
    43
#define __PRINT2(t,a,b) {RDebug::Print(t,a,b);}
sl@0
    44
#define __PRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
sl@0
    45
#define __PRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
sl@0
    46
#define __PRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
sl@0
    47
#define __PRINT8BIT1(t,a) {TFileName temp;temp.Copy(a);RDebug::Print(t,&temp);}
sl@0
    48
#define __PRINT1TEMP(t,a) {TBuf<KMaxFileName>temp(a);RDebug::Print(t,&temp);}
sl@0
    49
#define __PRINTERR(txt, err) {if(KErrNone != err) __PRINT1(txt, err);}
sl@0
    50
sl@0
    51
_LIT(KMsgIn, ">>%S\n");
sl@0
    52
_LIT(KMsgOut,"<<%S\n");
sl@0
    53
sl@0
    54
class TMSLogFn
sl@0
    55
{
sl@0
    56
	protected:
sl@0
    57
	TBuf<100> iName;
sl@0
    58
sl@0
    59
	public:
sl@0
    60
	TMSLogFn(const TDesC& aName){iName = aName; RDebug::Print(KMsgIn, &iName);};
sl@0
    61
	~TMSLogFn(){RDebug::Print(KMsgOut, &iName);};
sl@0
    62
};
sl@0
    63
sl@0
    64
#define __FNLOG(name) TMSLogFn __fn_log__(_L(name))
sl@0
    65
sl@0
    66
#else
sl@0
    67
#define __PRINT(t)
sl@0
    68
#define __PRINT1(t,a)
sl@0
    69
#define __PRINT2(t,a,b)
sl@0
    70
#define __PRINT3(t,a,b,c)
sl@0
    71
#define __PRINT4(t,a,b,c,d)
sl@0
    72
#define __PRINT5(t,a,b,c,d,e)
sl@0
    73
#define __PRINT8BIT1(t,a)
sl@0
    74
#define __PRINT1TEMP(t,a)
sl@0
    75
#define __PRINTERR(txt,err)
sl@0
    76
#define __FNLOG(name)
sl@0
    77
#endif
sl@0
    78
sl@0
    79
sl@0
    80
#if defined(_SCSI_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
sl@0
    81
#define __SCSIPRINT(t) {RDebug::Print(t);}
sl@0
    82
#define __SCSIPRINT1(t,a) {RDebug::Print(t,a);}
sl@0
    83
#define __SCSIPRINT2(t,a,b) {RDebug::Print(t,a,b);}
sl@0
    84
#define __SCSIPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
sl@0
    85
#define __SCSIPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
sl@0
    86
#define __SCSIPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
sl@0
    87
#else
sl@0
    88
#define __SCSIPRINT(t)
sl@0
    89
#define __SCSIPRINT1(t,a)
sl@0
    90
#define __SCSIPRINT2(t,a,b)
sl@0
    91
#define __SCSIPRINT3(t,a,b,c)
sl@0
    92
#define __SCSIPRINT4(t,a,b,c,d)
sl@0
    93
#define __SCSIPRINT5(t,a,b,c,d,e)
sl@0
    94
#endif
sl@0
    95
sl@0
    96
sl@0
    97
#if defined(_BOT_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
sl@0
    98
#define __BOTPRINT(t) {RDebug::Print(t);}
sl@0
    99
#define __BOTPRINT1(t,a) {RDebug::Print(t,a);}
sl@0
   100
#define __BOTPRINT2(t,a,b) {RDebug::Print(t,a,b);}
sl@0
   101
#define __BOTPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
sl@0
   102
#define __BOTPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
sl@0
   103
#define __BOTPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
sl@0
   104
#else
sl@0
   105
#define __BOTPRINT(t)
sl@0
   106
#define __BOTPRINT1(t,a)
sl@0
   107
#define __BOTPRINT2(t,a,b)
sl@0
   108
#define __BOTPRINT3(t,a,b,c)
sl@0
   109
#define __BOTPRINT4(t,a,b,c,d)
sl@0
   110
#define __BOTPRINT5(t,a,b,c,d,e)
sl@0
   111
#endif
sl@0
   112
sl@0
   113
sl@0
   114
#if defined(_CLIENT_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
sl@0
   115
#define __CLIENTPRINT(t) {RDebug::Print(t);}
sl@0
   116
#define __CLIENTPRINT1(t,a) {RDebug::Print(t,a);}
sl@0
   117
#define __CLIENTPRINT2(t,a,b) {RDebug::Print(t,a,b);}
sl@0
   118
#define __CLIENTPRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
sl@0
   119
#define __CLIENTPRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
sl@0
   120
#define __CLIENTPRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
sl@0
   121
#else
sl@0
   122
#define __CLIENTPRINT(t)
sl@0
   123
#define __CLIENTPRINT1(t,a)
sl@0
   124
#define __CLIENTPRINT2(t,a,b)
sl@0
   125
#define __CLIENTPRINT3(t,a,b,c)
sl@0
   126
#define __CLIENTPRINT4(t,a,b,c,d)
sl@0
   127
#define __CLIENTPRINT5(t,a,b,c,d,e)
sl@0
   128
#endif
sl@0
   129
sl@0
   130
sl@0
   131
#if defined(_TESTREPORT_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
sl@0
   132
#define __TESTREPORT(t) {RDebug::Print(t);}
sl@0
   133
#define __TESTREPORT1(t,a) {RDebug::Print(t,a);}
sl@0
   134
#define __TESTREPORT2(t,a,b) {RDebug::Print(t,a,b);}
sl@0
   135
#define __TESTREPORT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
sl@0
   136
#define __TESTREPORT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
sl@0
   137
#define __TESTREPORT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
sl@0
   138
#else
sl@0
   139
#define __TESTREPORT(t)
sl@0
   140
#define __TESTREPORT1(t,a)
sl@0
   141
#define __TESTREPORT2(t,a,b)
sl@0
   142
#define __TESTREPORT3(t,a,b,c)
sl@0
   143
#define __TESTREPORT4(t,a,b,c,d)
sl@0
   144
#define __TESTREPORT5(t,a,b,c,d,e)
sl@0
   145
#endif
sl@0
   146
sl@0
   147
sl@0
   148
#if defined(_TESTMODE_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
sl@0
   149
#define PREFIX(aMsg) TPtrC( (const TText*)L"[TM]: " L##aMsg )
sl@0
   150
sl@0
   151
#define __TESTMODEPRINT(t) {RDebug::Print(PREFIX(t));}
sl@0
   152
#define __TESTMODEPRINT1(t,a) {RDebug::Print(PREFIX(t),a);}
sl@0
   153
#define __TESTMODEPRINT2(t,a,b) {RDebug::Print(PREFIX(t),a,b);}
sl@0
   154
#define __TESTMODEPRINT3(t,a,b,c) {RDebug::Print(PREFIX(t),a,b,c);}
sl@0
   155
#define __TESTMODEPRINT4(t,a,b,c,d) {RDebug::Print(PREFIX(t),a,b,c,d);}
sl@0
   156
#define __TESTMODEPRINT5(t,a,b,c,d,e) {RDebug::Print(PREFIX(t),a,b,c,d,e);}
sl@0
   157
#else
sl@0
   158
#define __TESTMODEPRINT(t)
sl@0
   159
#define __TESTMODEPRINT1(t,a)
sl@0
   160
#define __TESTMODEPRINT2(t,a,b)
sl@0
   161
#define __TESTMODEPRINT3(t,a,b,c)
sl@0
   162
#define __TESTMODEPRINT4(t,a,b,c,d)
sl@0
   163
#define __TESTMODEPRINT5(t,a,b,c,d,e)
sl@0
   164
#endif
sl@0
   165
sl@0
   166
#endif // DEBUG_H