uiacceltk/hitchcock/plugins/alftranseffect/alftranseffectplugin/inc/debug.h
changeset 0 15bf7259bb7c
equal deleted inserted replaced
-1:000000000000 0:15bf7259bb7c
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef DEBUG_H
       
    19 #define DEBUG_H
       
    20 
       
    21 #include <e32debug.h>
       
    22 
       
    23 #ifdef _DEBUG //No debugging unless in Debug mode...
       
    24 	//#define DEBUG_ON_TARGET //define to get debug output also on target.
       
    25 	#ifdef __WINS__
       
    26 		//This is the config on emulator.
       
    27 		//#define DEBUG_PRINTS 
       
    28 		//#define DEBUGPRINTS_AS_FLOG
       
    29 
       
    30 	#elif defined(DEBUG_ON_TARGET)
       
    31 		//This is the config for target, when debuging on target is on.
       
    32 		#define DEBUG_PRINTS
       
    33 		//#define DEBUGPRINTS_AS_FLOG
       
    34 
       
    35 	#endif
       
    36 #endif
       
    37 //#define FLOG_PRINTS //This can be used to use FLOGs without support for DEBUG_PRINTS.. probably not useful...
       
    38 
       
    39 
       
    40 
       
    41 #if defined(FLOG_PRINTS) || defined(DEBUGPRINTS_AS_FLOG)
       
    42 
       
    43 	#include <flogger.h>
       
    44 	_LIT(KLogFile, "AlfFxServerLog.txt");
       
    45 	_LIT(KLogDir, "AlfGfxtest");
       
    46 
       
    47 	#define FLOG(x) RFileLogger::Write(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x))
       
    48 	#define FLOG1(x,a1) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1)
       
    49 	#define FLOG2(x,a1,a2) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2)
       
    50 	#define FLOG3(x,a1,a2,a3) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2,a3)
       
    51 	#define FLOG4(x,a1,a2,a3,a4) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2,a3,a4)
       
    52 	#define FLOG5(x,a1,a2,a3,a4,a5) RFileLogger::WriteFormat(KLogDir,KLogFile,EFileLoggingModeAppend,_LIT(x),a1,a2,a3,a4,a5)
       
    53 
       
    54 #else
       
    55 
       
    56 	#define FLOG(x)
       
    57 	#define FLOG1(x,a1)
       
    58 	#define FLOG2(x,a1,a2)
       
    59 	#define FLOG3(x,a1,a2,a3)
       
    60 	#define FLOG4(x,a1,a2,a3,a4) 
       
    61 	#define FLOG5(x,a1,a2,a3,a4,a5) 
       
    62 
       
    63 #endif
       
    64 
       
    65 #if defined(DEBUG_PRINTS) && !defined(DEBUGPRINTS_AS_FLOG)
       
    66 	// Prints via RDebug
       
    67 	#define DEBUG_PRINT(x) RDebug::Printf("AFX:  "##x)
       
    68 	#define DEBUG_PRINT1(x, a1) RDebug::Printf("AFX:  "##x, a1)
       
    69 	#define DEBUG_PRINT2(x, a1, a2) RDebug::Printf("AFX:  "##x, a1, a2)
       
    70 	#define DEBUG_PRINT3(x, a1, a2, a3) RDebug::Printf("AFX:  "##x, a1, a2, a3)
       
    71 	#define DEBUG_PRINT4(x, a1, a2, a3, a4) RDebug::Printf("AFX:  "##x, a1, a2, a3, a4)
       
    72 	#define DEBUG_PRINT5(x, a1, a2, a3, a4, a5) RDebug::Printf("AFX:  "##x, a1, a2, a3, a4, a5)
       
    73 
       
    74 #elif defined(DEBUGPRINTS_AS_FLOG)
       
    75 	// Prints via flogger
       
    76 	#define DEBUG_PRINT(x) FLOG(x)
       
    77 	#define DEBUG_PRINT1(x, a1) FLOG1(x, a1)
       
    78 	#define DEBUG_PRINT2(x, a1, a2) FLOG2(x, a1, a2)
       
    79 	#define DEBUG_PRINT3(x, a1, a2, a3) FLOG3(x, a1, a2, a3)
       
    80 	#define DEBUG_PRINT4(x, a1, a2, a3, a4) FLOG4(x, a1, a2, a3, a4)
       
    81 	#define DEBUG_PRINT5(x, a1, a2, a3, a4, a5) FLOG5(x, a1, a2, a3, a4, a5)
       
    82 
       
    83 #else 
       
    84 	/*lint -e960 */
       
    85 	// No prints
       
    86 	#define DEBUG_PRINT(x) 
       
    87 	#define DEBUG_PRINT1(x, a1) 
       
    88 	#define DEBUG_PRINT2(x, a1, a2) 
       
    89 	#define DEBUG_PRINT3(x, a1, a2, a3) 
       
    90 	#define DEBUG_PRINT4(x, a1, a2, a3, a4) 
       
    91 	#define DEBUG_PRINT5(x, a1, a2, a3, a4, a5)
       
    92 	/*lint +e960 */
       
    93 	
       
    94 #endif // DEBUG_PRINTS
       
    95 
       
    96 #endif // DEBUG_H