1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/fileserver/shostmassstorage/client/debug.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,78 @@
1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +
1.19 +/**
1.20 + @file
1.21 + @internalTechnology
1.22 +*/
1.23 +
1.24 +#ifndef DEBUG_H
1.25 +#define DEBUG_H
1.26 +
1.27 +#if (defined(_DEBUG) || defined(_DEBUG_RELEASE))
1.28 +#include <e32debug.h>
1.29 +#endif
1.30 +
1.31 +// #define _USBMS_DEBUG_PRINT_
1.32 +
1.33 +#if defined(_USBMS_DEBUG_PRINT_) && (defined(_DEBUG) || defined(_DEBUG_RELEASE))
1.34 +/** Trace - format string */
1.35 +#define __PRINT(t) {RDebug::Print(t);}
1.36 +/** Trace - format string with 1 param */
1.37 +#define __PRINT1(t,a) {RDebug::Print(t,a);}
1.38 +/** Trace - format string with 2 params */
1.39 +#define __PRINT2(t,a,b) {RDebug::Print(t,a,b);}
1.40 +/** Trace - format string with 3 params */
1.41 +#define __PRINT3(t,a,b,c) {RDebug::Print(t,a,b,c);}
1.42 +/** Trace - format string with 4 params */
1.43 +#define __PRINT4(t,a,b,c,d) {RDebug::Print(t,a,b,c,d);}
1.44 +/** Trace - format string with 5 params */
1.45 +#define __PRINT5(t,a,b,c,d,e) {RDebug::Print(t,a,b,c,d,e);}
1.46 +
1.47 +
1.48 +_LIT(KMsgIn, ">>%S\n");
1.49 +_LIT(KMsgOut,"<<%S\n");
1.50 +
1.51 +class TMSLogFn
1.52 +{
1.53 + protected:
1.54 + TBuf<100> iName;
1.55 +
1.56 + public:
1.57 + TMSLogFn(const TDesC& aName){iName = aName; RDebug::Print(KMsgIn, &iName);};
1.58 + ~TMSLogFn(){RDebug::Print(KMsgOut, &iName);};
1.59 +};
1.60 +
1.61 +#define __FNLOG(name) TMSLogFn __fn_log__(_L(name))
1.62 +
1.63 +#else
1.64 +
1.65 +/** NULL definition */
1.66 +#define __PRINT(t)
1.67 +/** NULL definition */
1.68 +#define __PRINT1(t,a)
1.69 +/** NULL definition */
1.70 +#define __PRINT2(t,a,b)
1.71 +/** NULL definition */
1.72 +#define __PRINT3(t,a,b,c)
1.73 +/** NULL definition */
1.74 +#define __PRINT4(t,a,b,c,d)
1.75 +/** NULL definition */
1.76 +#define __PRINT5(t,a,b,c,d,e)
1.77 +/** NULL definition */
1.78 +#define __FNLOG(name)
1.79 +#endif
1.80 +
1.81 +#endif // DEBUG_H