btobexprofiles/obexsendservices/obexservicesendutils/inc/BTSUDebug.h
branchRCL_3
changeset 56 9386f31cc85b
parent 55 613943a21004
child 61 269724087bed
equal deleted inserted replaced
55:613943a21004 56:9386f31cc85b
     1 /*
       
     2 * Copyright (c) 2002 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:  This file defines logging macros for BTSU.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef BT_SERVICE_UTILS_DEBUG_H
       
    20 #define BT_SERVICE_UTILS_DEBUG_H
       
    21 
       
    22 
       
    23 #ifdef _DEBUG
       
    24 // ===========================================================================
       
    25 #ifdef __WINS__     // File logging for WINS
       
    26 // ===========================================================================
       
    27 #include <e32std.h>
       
    28 #include <f32file.h>
       
    29 #include <flogger.h>
       
    30 
       
    31 _LIT(KLogFile,"btsuLog.txt");
       
    32 _LIT(KLogDirFullName,"c:\\logs\\btsu\\");
       
    33 _LIT(KLogDir,"btsu");
       
    34 
       
    35 #define FLOG(a)   { FPrint(a); }
       
    36 #define FTRACE(a) { a; }
       
    37 
       
    38 // Declare the FPrint function
       
    39 //
       
    40 inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
       
    41     {
       
    42     VA_LIST list;
       
    43     VA_START(list,aFmt);
       
    44     RFileLogger::WriteFormat(KLogDir, KLogFile, EFileLoggingModeAppend, aFmt, list);
       
    45     }
       
    46 
       
    47 // ===========================================================================
       
    48 #else               // RDebug logging for target HW
       
    49 // ===========================================================================
       
    50 #include <e32svr.h>
       
    51 
       
    52 #define FLOG(a)   { RDebug::Print(a); }
       
    53 #define FTRACE(a) { a; }
       
    54 
       
    55 // Declare the FPrint function
       
    56 //
       
    57 inline void FPrint(const TRefByValue<const TDesC> aFmt, ...)
       
    58     {
       
    59     VA_LIST list;
       
    60     VA_START(list,aFmt);
       
    61     TInt tmpInt = VA_ARG(list, TInt);
       
    62     TInt tmpInt2 = VA_ARG(list, TInt);
       
    63     TInt tmpInt3 = VA_ARG(list, TInt);
       
    64     VA_END(list);
       
    65     RDebug::Print(aFmt, tmpInt, tmpInt2, tmpInt3);
       
    66     }
       
    67 
       
    68 #endif //__WINS__
       
    69 
       
    70 // ===========================================================================
       
    71 #else // // No loggings --> Reduced binary size
       
    72 // ===========================================================================
       
    73 #define FLOG(a)
       
    74 #define FTRACE(a)
       
    75 
       
    76 #endif // _DEBUG
       
    77 
       
    78 
       
    79 #endif // BT_SERVICE_UTILS_DEBUG_H
       
    80 
       
    81 // End of File