loggingservices/eventlogger/LogServ/inc/logservpanic.h
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 2002-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 #ifndef __LOGSERVPANIC_H__
       
    17 #define __LOGSERVPANIC_H__
       
    18 
       
    19 // System includes
       
    20 #include <e32base.h>
       
    21 
       
    22 /**
       
    23 Enumerations
       
    24 @internalComponent
       
    25 */
       
    26 enum TLogServPanic
       
    27 	{
       
    28 	ELogAlreadyActive1,			// 0
       
    29 	ELogAlreadyActive2,
       
    30 	ELogAlreadyActive3,
       
    31 	ELogAlreadyActive4,
       
    32 	ELogAlreadyActive5,
       
    33 	ELogAlreadyActive6,
       
    34 	ELogAlreadyActive7,
       
    35 	ELogAlreadyActive8,
       
    36 	ELogAlreadyActive9,
       
    37 	ELogAlreadyActive10,
       
    38 	ELogAlreadyActive11,		// 10
       
    39 	ELogAlreadyActive12,
       
    40 	ELogAlreadyActive13,
       
    41 	ELogAlreadyActive14,
       
    42 	ELogAlreadyActive15,
       
    43 	ELogAlreadyActive16,
       
    44 	ELogAlreadyActive17,
       
    45 	ELogAlreadyActive18,
       
    46 	ELogAlreadyActive19,
       
    47 	ELogAlreadyActive20,
       
    48 	ELogNoSuchColumn,			// 20
       
    49 	ELogQueryEvaluated,
       
    50 	ELogNoSuchState1,
       
    51 	ELogNoSuchState2,
       
    52 	ELogNoSuchState3,
       
    53 	ELogNoSuchState4,
       
    54 	ELogNoSuchState5,
       
    55 	ELogNoSuchState6,
       
    56 	ELogNoSuchState7,
       
    57 	ELogTooManyRows1,
       
    58 	ELogTooManyRows2,			// 30
       
    59 	ELogTooManyRows3,
       
    60 	ELogTooManyRows4,
       
    61 	ELogTooManyRows5,
       
    62 	ELogTooManyRows6,
       
    63 	ELogNoFirstRow1,
       
    64 	ELogNoFirstRow2,
       
    65 	ELogStringTooBig1,
       
    66 	ELogStringTooBig2,
       
    67 	ELogBadState1,
       
    68 	ELogBadState2,				// 40
       
    69 	ELogBadState3,
       
    70 	ELogBadState4,
       
    71 	ELogBadState5,
       
    72 	ELogBadState6,
       
    73 	ELogBadState7,
       
    74 	ELogDesEmpty1,
       
    75 	ELogDesEmpty2,
       
    76 	ELogDesEmpty3,
       
    77 	ELogDesEmpty4,
       
    78 	ELogNotValid,				// 50
       
    79 	ELogDatabaseDamaged1,
       
    80 	ELogDatabaseDamaged2,
       
    81 	ELogDatabaseDamaged3,
       
    82 	ELogDatabaseDamaged4,
       
    83 	ELogRecoverError,
       
    84 	ELogUnknownField,
       
    85 	ELogNullRecentList,
       
    86 	ELogNullFilterInList1,
       
    87 	ELogNullFilterInList2,
       
    88 	ELogNullFilterInList3,		// 60
       
    89 	ELogNullFilterInList4,
       
    90 	ELogDatabaseAlreadyOpen,
       
    91 	ELogBadDescriptor,
       
    92 	ELogIllegalFunction,
       
    93 	ELogStartBackupFailure,
       
    94 	ELogInvalidRecentView,
       
    95 	ELogInvalidQuery,
       
    96 	ELogNotifyListsNotEmpty,
       
    97 	ELogBeginInTransaction,
       
    98 	ELogCommitNotInTransaction,	// 70
       
    99 	ELogRollbackNotInTransaction,
       
   100 	ELogNothingHasChanged,
       
   101 	ELogEventAlreadyInView,
       
   102 	ELogServFactoryUnrecognizedOperationType,
       
   103 	ELogServFactoryUnrecognizedOperationType2,
       
   104 	ELogServFactoryUnrecognizedViewType,
       
   105 	ELogNoOutstandingAsyncRequest,
       
   106 	ELogBackupObserversStillRegistered,
       
   107 	ELogNoResourceForId,
       
   108 	ELogNoChangeInterfacePointer, // 80
       
   109 	ELogUnrecognizedChangeType,
       
   110 	ELogUnrecognizedChangeType2,
       
   111 	ELogInappropriateChangeType,
       
   112 	ELogViewChangeRequestAlreadyIssued,
       
   113 	ELogViewNoClientChangeMessageOutstanding,
       
   114 	ELogViewBadClientSideChangeBufferSize,
       
   115 	ELogInvalidRecentView2,
       
   116 	ELogCacheAccessDuringBackupStrings,
       
   117 	ELogCacheAccessDuringBackupTypes,
       
   118 	ELogCacheAccessDuringBackupConfig, // 90
       
   119 	ELogTypeEntryCacheDescriptionMemoryError,
       
   120 	ELogCacheConfigAlreadyInTransaction,
       
   121 	ELogCacheConfigNotInTransaction,
       
   122 	ELogChangeConfigLogicError,
       
   123 	ELogBackupManagerMultipleObservationRequestsFromObject,
       
   124 	ELogViewNotSetupForChangesFetch,
       
   125 	ELogViewRecentViewNotYetReadyForFlagSetting,
       
   126 	ELogViewBadWindow,
       
   127 	ELogViewNoLockStatusChangeMessage,
       
   128 	ELogViewLockStatusChangeRequestAlreadyIssued, // 100
       
   129 	ELogViewWindowFetcherBadState,
       
   130 	ELogViewWindowFetcherBadState2,
       
   131 	ELogBadFilterConstructionType,
       
   132 	ELogViewNoPendingChangesToDeliver,
       
   133 	ELogExtendedMessageAlreadyActive,
       
   134 	ELogViewWindowFetcherBadState3,
       
   135 	ELogSecurityCapabilitiesUndefined,
       
   136 	ELogTooManyCapabilities,
       
   137 	ELogUnknownCapability,
       
   138 	ELogNoEventTypeAtId,							// 110
       
   139 	ELogMismatchedId,
       
   140 	ELogQueryNullColSet,
       
   141 	ELogStringsCacheReserved,
       
   142 	ELogStringsCacheNullArg1,
       
   143 	ELogStringsCacheNullArg2,
       
   144 	ELogTypesCacheReserved,
       
   145 	ELogTypesCacheNotInTransaction,
       
   146 	ELogInvalidStringColNo,
       
   147 	ELogInvalidTypeColNo,
       
   148 	ELogTypeCacheNullArg,							//120
       
   149     ELogInvalidConfigColNo,
       
   150     ELogInvalidConstructionType,
       
   151     ELogArrayReserved
       
   152 	};
       
   153 
       
   154 const TInt KLogPanicLeave = -1001;
       
   155 
       
   156 /**
       
   157 Utility functions
       
   158 @internalComponent
       
   159 */
       
   160 void Panic(TLogServPanic aPanic);
       
   161 void PanicClientL(const RMessage2& aMessage, TLogServPanic aPanic);
       
   162 void PanicClient(const RMessage2& aMessage, TLogServPanic aPanic);
       
   163 
       
   164 #ifdef LOGGING_ENABLED
       
   165 
       
   166 #include <f32file.h>
       
   167 #include <flogger.h>
       
   168 
       
   169 /**
       
   170 @internalComponent
       
   171 */
       
   172 _LIT(KLogFileName, "LogEng.txt");
       
   173 _LIT(KLogFolder,   "LogEng");
       
   174 _LIT(KTimeFormat, "%02d.%02d:%02d:%06d    ");
       
   175 _LIT(KTextFormat, "%S");
       
   176 
       
   177 class Log : public RFileLogger
       
   178 /**
       
   179 @internalComponent
       
   180 */
       
   181 	{
       
   182 public:
       
   183 	static void New();
       
   184 	static void Write(const TDesC& aText);
       
   185 	static void WriteFormat(TRefByValue<const TDesC> aFmt, ...);
       
   186 
       
   187 private:
       
   188 	static void PruneLogFile();
       
   189     };
       
   190 
       
   191 /**
       
   192 @internalComponent
       
   193 */
       
   194 #define LOGNEW							Log::New()
       
   195 #define LOGTEXT(AAA)					{ _LIT(KString, AAA); Log::Write(KString); }
       
   196 #define LOGTEXT2(AAA, BBB)				{ _LIT(KString, AAA); Log::WriteFormat(TRefByValue<const TDesC>(KString()), BBB); }
       
   197 #define LOGTEXT3(AAA, BBB, CCC)			{ _LIT(KString, AAA); Log::WriteFormat(TRefByValue<const TDesC>(KString()), BBB, CCC); }
       
   198 #define LOGTEXT4(AAA, BBB, CCC, DDD)	{ _LIT(KString, AAA); Log::WriteFormat(TRefByValue<const TDesC>(KString()), BBB, CCC, DDD); }
       
   199 
       
   200 #else
       
   201 
       
   202 #define LOGNEW
       
   203 #define LOGTEXT(AAA)
       
   204 #define LOGTEXT2(AAA, BBB)
       
   205 #define LOGTEXT3(AAA, BBB, CCC)
       
   206 #define LOGTEXT4(AAA, BBB, CCC, DDD)
       
   207 
       
   208 #endif
       
   209 
       
   210 
       
   211 #endif