telephonyserver/etelmultimode/DTsy/Dmmlog.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalAll 
       
    19 */
       
    20 
       
    21 #define __LOGGER__
       
    22 
       
    23 //#if defined (_DEBUG)
       
    24 
       
    25 #ifdef __LOGGER__
       
    26 #define LOGTEXT(AAA)	CDTSYLogger::Write(AAA)
       
    27 #else
       
    28 #define LOGTEXT(AAA)
       
    29 #endif
       
    30 
       
    31 #ifdef __LOGGER__
       
    32 #define LOGTEXT2(AAA,BBB)	CDTSYLogger::WriteFormat(TRefByValue<const TDesC8>(AAA),BBB)
       
    33 #else
       
    34 #define LOGTEXT2(AAA,BBB)
       
    35 #endif
       
    36 
       
    37 #ifdef __LOGGER__
       
    38 #define LOGTEXT3(AAA,BBB,CCC)	CDTSYLogger::WriteFormat(TRefByValue<const TDesC8>(AAA),BBB,CCC)
       
    39 #else
       
    40 #define LOGTEXT3(AAA,BBB,CCC)
       
    41 #endif
       
    42 
       
    43 #define LOGTEXTREL(AAA)
       
    44 #define LOGTEXTREL2(AAA,BBB)
       
    45 #define LOGTEXTREL3(AAA,BBB,CCC)
       
    46 
       
    47 /*#else
       
    48 
       
    49 #define LOGTEXT(AAA)
       
    50 #define LOGTEXT2(AAA,BBB)
       
    51 #define LOGTEXT3(AAA,BBB,CCC)
       
    52 
       
    53 #ifdef __LOGGER__
       
    54 #define LOGTEXTREL(AAA)	CDTSYLogger::Write(AAA)
       
    55 #else
       
    56 #define LOGTEXTREL(AAA)
       
    57 #endif
       
    58 
       
    59 #ifdef __LOGGER__
       
    60 #define LOGTEXTREL2(AAA,BBB)	CDTSYLogger::WriteFormat(TRefByValue<const TDesC8>(AAA),BBB)
       
    61 #else
       
    62 #define LOGTEXTREL2(AAA,BBB)
       
    63 #endif
       
    64 
       
    65 #ifdef __LOGGER__
       
    66 #define LOGTEXTREL3(AAA,BBB,CCC)	CDTSYLogger::WriteFormat(TRefByValue<const TDesC8>(AAA),BBB,CCC)
       
    67 #else
       
    68 #define LOGTEXTREL3(AAA,BBB,CCC)
       
    69 #endif
       
    70 
       
    71 #endif		
       
    72 */
       
    73 #ifdef __LOGGER__
       
    74 #define LOGDESTROY()	CDTSYLogger::Destruct()
       
    75 #else
       
    76 #define LOGDESTROY()
       
    77 #endif
       
    78 
       
    79 
       
    80 #ifndef __SLOGGER_H
       
    81 #define __SLOGGER_H
       
    82 
       
    83 #ifdef __LOGGER__
       
    84 #include <f32file.h>
       
    85 
       
    86 class CDTSYLogger : public CBase
       
    87 	{
       
    88 public:
       
    89 	static CDTSYLogger* NewL();
       
    90 	CDTSYLogger();
       
    91 	void ConstructL();
       
    92 	static void Destruct();
       
    93 	~CDTSYLogger();
       
    94 	static void Write(const TDesC8& aText);
       
    95 	static void WriteFormat(TRefByValue<const TDesC8> aFmt,...);
       
    96 	void WriteRecord(const TDesC8& aText);
       
    97 private:
       
    98 	TBool iValid;
       
    99 	RFs iFs;
       
   100 	RFile iFile;
       
   101 	};
       
   102 
       
   103 #endif	// __LOGGER__
       
   104 
       
   105 #endif	// __SLOGGER_H