loadgen/inc/loadgen_traces.h
changeset 0 d6fe6244b863
equal deleted inserted replaced
-1:000000000000 0:d6fe6244b863
       
     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 
       
    19 
       
    20 
       
    21 #ifndef __LOADGEN_TRACES_H__
       
    22 #define __LOADGEN_TRACES_H__
       
    23 
       
    24 #include <e32def.h>
       
    25 
       
    26 
       
    27 // ---------------------------------------------------------------------------
       
    28 // You change these logging method values below! Recompile the application to take changes effect.
       
    29 
       
    30     // logging methods
       
    31     // 0 = No logging
       
    32     // 1 = Flogger
       
    33     // 2 = RDebug
       
    34     // 3 = Flogger and RDebug
       
    35     
       
    36     #ifndef _DEBUG
       
    37         
       
    38         // Logging method for UREL builds:
       
    39         #define LOADGEN_LOGGING_METHOD  3
       
    40 
       
    41     #else
       
    42 
       
    43         // Logging method for UDEB builds:
       
    44         #define LOADGEN_LOGGING_METHOD  3
       
    45 
       
    46     #endif    
       
    47     
       
    48 
       
    49 
       
    50 // ---------------------------------------------------------------------------
       
    51 // Do not make any changes to lines below...
       
    52 
       
    53     #if LOADGEN_LOGGING_METHOD == 1 || LOADGEN_LOGGING_METHOD == 3
       
    54 
       
    55         #include <flogger.h>
       
    56         _LIT(KLogFolder,"loadgen");
       
    57         _LIT(KLogFile,"loadgen_trace.txt");
       
    58 
       
    59     #endif
       
    60 
       
    61     #if LOADGEN_LOGGING_METHOD == 2 || LOADGEN_LOGGING_METHOD == 3
       
    62 
       
    63         #include <e32debug.h>
       
    64 
       
    65     #endif
       
    66 
       
    67 
       
    68     #if LOADGEN_LOGGING_METHOD == 0
       
    69     
       
    70         #define LOGTEXT(AAA)
       
    71         #define LOGSTRING(AAA)
       
    72         #define LOGSTRING2(AAA,BBB)
       
    73         #define LOGSTRING3(AAA,BBB,CCC)
       
    74         #define LOGSTRING4(AAA,BBB,CCC,DDD)
       
    75     
       
    76     
       
    77     #elif LOADGEN_LOGGING_METHOD == 1
       
    78     
       
    79         #define LOGTEXT(AAA)                RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
       
    80         #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
       
    81         #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
       
    82         #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
       
    83         #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
       
    84    
       
    85     #elif LOADGEN_LOGGING_METHOD == 2
       
    86     
       
    87         #define LOGTEXT(AAA)                RDebug::Print(AAA)
       
    88         #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); } while (0)
       
    89         #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); } while (0)
       
    90         #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); } while (0)
       
    91         #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); } while (0)
       
    92     
       
    93     #elif LOADGEN_LOGGING_METHOD == 3
       
    94     
       
    95         #define LOGTEXT(AAA)                RDebug::Print(AAA); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend, AAA)
       
    96         #define LOGSTRING(AAA)              do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes); RFileLogger::Write(KLogFolder(),KLogFile(),EFileLoggingModeAppend,tempLogDes()); } while (0)
       
    97         #define LOGSTRING2(AAA,BBB)         do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB); } while (0)
       
    98         #define LOGSTRING3(AAA,BBB,CCC)     do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC); } while (0)
       
    99         #define LOGSTRING4(AAA,BBB,CCC,DDD) do { _LIT(tempLogDes,AAA); RDebug::Print(tempLogDes, BBB, CCC, DDD); RFileLogger::WriteFormat(KLogFolder(),KLogFile(),EFileLoggingModeAppend,TRefByValue<const TDesC>(tempLogDes()),BBB,CCC,DDD); } while (0)
       
   100 
       
   101     #endif
       
   102 
       
   103 // ---------------------------------------------------------------------------
       
   104 
       
   105 #endif // __LOADGEN_TRACES_H__
       
   106