omadm/omadmextensions/adapters/nsmldmbmadapter/inc/bmadapterlogger.h
changeset 18 7d11f9a6646f
parent 4 75a71fdb4c92
child 21 c707676bf59f
equal deleted inserted replaced
4:75a71fdb4c92 18:7d11f9a6646f
     1 /*
       
     2 * Copyright (c) 2006 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:   Logging functions for the component.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BMADAPTERLOGGER_H
       
    21 #define BMADAPTERLOGGER_H
       
    22 
       
    23 #ifndef _DEBUG
       
    24 
       
    25 // UREL BUILD:
       
    26 #define BMADAPTER_LOGGING_METHOD  0   // No logging in UREL builds
       
    27 
       
    28 #else
       
    29 
       
    30 // UDEB BUILD:
       
    31 #define BMADAPTER_LOGGING_METHOD  1     // 0 = No logging,
       
    32                                         // 1 = Flogger,
       
    33                                         // 2 = RDebug
       
    34 #endif // _DEBUG
       
    35 
       
    36 
       
    37 #if BMADAPTER_LOGGING_METHOD == 1 // Flogger
       
    38 
       
    39 #include <flogger.h>
       
    40 _LIT(KBMADAPTERLOGFolder,"NSMLDMBMADAPTER");
       
    41 _LIT(KBMADAPTERLOGFile,"NSMLDMBMADAPTER.txt");
       
    42 
       
    43 #define BMADAPTERLOGTEXT(x)\
       
    44     {\
       
    45     RFileLogger::Write(KBMADAPTERLOGFolder(),KBMADAPTERLOGFile(),EFileLoggingModeAppend,\
       
    46     x);\
       
    47     }
       
    48 
       
    49 #define BMADAPTERLOGSTRING(x)\
       
    50     {\
       
    51     _LIT8(tempLogDes,x);\
       
    52     RFileLogger::Write(KBMADAPTERLOGFolder(),KBMADAPTERLOGFile(),EFileLoggingModeAppend,\
       
    53     tempLogDes());\
       
    54     }
       
    55 
       
    56 #define BMADAPTERLOGSTRING2(x,y)\
       
    57     { _LIT8(tempLogDes,x);\
       
    58     RFileLogger::WriteFormat(KBMADAPTERLOGFolder(),\
       
    59                              KBMADAPTERLOGFile(),\
       
    60                              EFileLoggingModeAppend,\
       
    61                              TRefByValue<const TDesC8>(tempLogDes()),y);\
       
    62     }
       
    63 
       
    64 #define BMADAPTERLOGSTRING3(x,y,z)\
       
    65     { _LIT8(tempLogDes,x);\
       
    66     RFileLogger::WriteFormat(KBMADAPTERLOGFolder(),\
       
    67                              KBMADAPTERLOGFile(),\
       
    68                              EFileLoggingModeAppend,\
       
    69     TRefByValue<const TDesC8>(tempLogDes()),y,z);\
       
    70     }
       
    71 
       
    72 #define BMADAPTERLOGSTRING4(w,x,y,z)\
       
    73     { _LIT8(tempLogDes,w);\
       
    74     RFileLogger::WriteFormat(KBMADAPTERLOGFolder(),\
       
    75                              KBMADAPTERLOGFile(),\
       
    76                              EFileLoggingModeAppend,\
       
    77     TRefByValue<const TDesC8>(tempLogDes()),x,y,z);\
       
    78     }
       
    79 
       
    80 
       
    81 #elif BMADAPTER_LOGGING_METHOD == 2    // RDebug
       
    82 
       
    83 #include <e32svr.h>
       
    84 
       
    85 #define BMADAPTERLOGSTRING(x) RDebug::Print(x);
       
    86 #define BMADAPTERLOGSTRING(x) RDebug::Print(_L(x));
       
    87 #define BMADAPTERLOGSTRING2(x,y) RDebug::Print(_L(x),y);
       
    88 #define BMADAPTERLOGSTRING3(x,y,z) RDebug::Print(_L(x),y,z);
       
    89 #define BMADAPTERLOGSTRING4(w,x,y,z) RDebug::Print(_L(w),x,y,z);
       
    90 
       
    91 #else // BMADAPTER_LOGGING_METHOD == 0 or invalid
       
    92 
       
    93 #define BMADAPTERLOGSTRING(x)
       
    94 #define BMADAPTERLOGSTRING(x)
       
    95 #define BMADAPTERLOGSTRING2(x,y)
       
    96 #define BMADAPTERLOGSTRING3(x,y,z)
       
    97 #define BMADAPTERLOGSTRING4(w,x,y,z)
       
    98 
       
    99 #endif // BMADAPTER_LOGGING_METHOD
       
   100 
       
   101 #endif  // BMADAPTERLOGGER_H
       
   102 
       
   103 // End of File