sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __LOGSERVPANIC_H__ sl@0: #define __LOGSERVPANIC_H__ sl@0: sl@0: // System includes sl@0: #include sl@0: sl@0: /** sl@0: Enumerations sl@0: @internalComponent sl@0: */ sl@0: enum TLogServPanic sl@0: { sl@0: ELogAlreadyActive1, // 0 sl@0: ELogAlreadyActive2, sl@0: ELogAlreadyActive3, sl@0: ELogAlreadyActive4, sl@0: ELogAlreadyActive5, sl@0: ELogAlreadyActive6, sl@0: ELogAlreadyActive7, sl@0: ELogAlreadyActive8, sl@0: ELogAlreadyActive9, sl@0: ELogAlreadyActive10, sl@0: ELogAlreadyActive11, // 10 sl@0: ELogAlreadyActive12, sl@0: ELogAlreadyActive13, sl@0: ELogAlreadyActive14, sl@0: ELogAlreadyActive15, sl@0: ELogAlreadyActive16, sl@0: ELogAlreadyActive17, sl@0: ELogAlreadyActive18, sl@0: ELogAlreadyActive19, sl@0: ELogAlreadyActive20, sl@0: ELogNoSuchColumn, // 20 sl@0: ELogQueryEvaluated, sl@0: ELogNoSuchState1, sl@0: ELogNoSuchState2, sl@0: ELogNoSuchState3, sl@0: ELogNoSuchState4, sl@0: ELogNoSuchState5, sl@0: ELogNoSuchState6, sl@0: ELogNoSuchState7, sl@0: ELogTooManyRows1, sl@0: ELogTooManyRows2, // 30 sl@0: ELogTooManyRows3, sl@0: ELogTooManyRows4, sl@0: ELogTooManyRows5, sl@0: ELogTooManyRows6, sl@0: ELogNoFirstRow1, sl@0: ELogNoFirstRow2, sl@0: ELogStringTooBig1, sl@0: ELogStringTooBig2, sl@0: ELogBadState1, sl@0: ELogBadState2, // 40 sl@0: ELogBadState3, sl@0: ELogBadState4, sl@0: ELogBadState5, sl@0: ELogBadState6, sl@0: ELogBadState7, sl@0: ELogDesEmpty1, sl@0: ELogDesEmpty2, sl@0: ELogDesEmpty3, sl@0: ELogDesEmpty4, sl@0: ELogNotValid, // 50 sl@0: ELogDatabaseDamaged1, sl@0: ELogDatabaseDamaged2, sl@0: ELogDatabaseDamaged3, sl@0: ELogDatabaseDamaged4, sl@0: ELogRecoverError, sl@0: ELogUnknownField, sl@0: ELogNullRecentList, sl@0: ELogNullFilterInList1, sl@0: ELogNullFilterInList2, sl@0: ELogNullFilterInList3, // 60 sl@0: ELogNullFilterInList4, sl@0: ELogDatabaseAlreadyOpen, sl@0: ELogBadDescriptor, sl@0: ELogIllegalFunction, sl@0: ELogStartBackupFailure, sl@0: ELogInvalidRecentView, sl@0: ELogInvalidQuery, sl@0: ELogNotifyListsNotEmpty, sl@0: ELogBeginInTransaction, sl@0: ELogCommitNotInTransaction, // 70 sl@0: ELogRollbackNotInTransaction, sl@0: ELogNothingHasChanged, sl@0: ELogEventAlreadyInView, sl@0: ELogServFactoryUnrecognizedOperationType, sl@0: ELogServFactoryUnrecognizedOperationType2, sl@0: ELogServFactoryUnrecognizedViewType, sl@0: ELogNoOutstandingAsyncRequest, sl@0: ELogBackupObserversStillRegistered, sl@0: ELogNoResourceForId, sl@0: ELogNoChangeInterfacePointer, // 80 sl@0: ELogUnrecognizedChangeType, sl@0: ELogUnrecognizedChangeType2, sl@0: ELogInappropriateChangeType, sl@0: ELogViewChangeRequestAlreadyIssued, sl@0: ELogViewNoClientChangeMessageOutstanding, sl@0: ELogViewBadClientSideChangeBufferSize, sl@0: ELogInvalidRecentView2, sl@0: ELogCacheAccessDuringBackupStrings, sl@0: ELogCacheAccessDuringBackupTypes, sl@0: ELogCacheAccessDuringBackupConfig, // 90 sl@0: ELogTypeEntryCacheDescriptionMemoryError, sl@0: ELogCacheConfigAlreadyInTransaction, sl@0: ELogCacheConfigNotInTransaction, sl@0: ELogChangeConfigLogicError, sl@0: ELogBackupManagerMultipleObservationRequestsFromObject, sl@0: ELogViewNotSetupForChangesFetch, sl@0: ELogViewRecentViewNotYetReadyForFlagSetting, sl@0: ELogViewBadWindow, sl@0: ELogViewNoLockStatusChangeMessage, sl@0: ELogViewLockStatusChangeRequestAlreadyIssued, // 100 sl@0: ELogViewWindowFetcherBadState, sl@0: ELogViewWindowFetcherBadState2, sl@0: ELogBadFilterConstructionType, sl@0: ELogViewNoPendingChangesToDeliver, sl@0: ELogExtendedMessageAlreadyActive, sl@0: ELogViewWindowFetcherBadState3, sl@0: ELogSecurityCapabilitiesUndefined, sl@0: ELogTooManyCapabilities, sl@0: ELogUnknownCapability, sl@0: ELogNoEventTypeAtId, // 110 sl@0: ELogMismatchedId, sl@0: ELogQueryNullColSet, sl@0: ELogStringsCacheReserved, sl@0: ELogStringsCacheNullArg1, sl@0: ELogStringsCacheNullArg2, sl@0: ELogTypesCacheReserved, sl@0: ELogTypesCacheNotInTransaction, sl@0: ELogInvalidStringColNo, sl@0: ELogInvalidTypeColNo, sl@0: ELogTypeCacheNullArg, //120 sl@0: ELogInvalidConfigColNo, sl@0: ELogInvalidConstructionType, sl@0: ELogArrayReserved sl@0: }; sl@0: sl@0: const TInt KLogPanicLeave = -1001; sl@0: sl@0: /** sl@0: Utility functions sl@0: @internalComponent sl@0: */ sl@0: void Panic(TLogServPanic aPanic); sl@0: void PanicClientL(const RMessage2& aMessage, TLogServPanic aPanic); sl@0: void PanicClient(const RMessage2& aMessage, TLogServPanic aPanic); sl@0: sl@0: #ifdef LOGGING_ENABLED sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: _LIT(KLogFileName, "LogEng.txt"); sl@0: _LIT(KLogFolder, "LogEng"); sl@0: _LIT(KTimeFormat, "%02d.%02d:%02d:%06d "); sl@0: _LIT(KTextFormat, "%S"); sl@0: sl@0: class Log : public RFileLogger sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: { sl@0: public: sl@0: static void New(); sl@0: static void Write(const TDesC& aText); sl@0: static void WriteFormat(TRefByValue aFmt, ...); sl@0: sl@0: private: sl@0: static void PruneLogFile(); sl@0: }; sl@0: sl@0: /** sl@0: @internalComponent sl@0: */ sl@0: #define LOGNEW Log::New() sl@0: #define LOGTEXT(AAA) { _LIT(KString, AAA); Log::Write(KString); } sl@0: #define LOGTEXT2(AAA, BBB) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue(KString()), BBB); } sl@0: #define LOGTEXT3(AAA, BBB, CCC) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue(KString()), BBB, CCC); } sl@0: #define LOGTEXT4(AAA, BBB, CCC, DDD) { _LIT(KString, AAA); Log::WriteFormat(TRefByValue(KString()), BBB, CCC, DDD); } sl@0: sl@0: #else sl@0: sl@0: #define LOGNEW sl@0: #define LOGTEXT(AAA) sl@0: #define LOGTEXT2(AAA, BBB) sl@0: #define LOGTEXT3(AAA, BBB, CCC) sl@0: #define LOGTEXT4(AAA, BBB, CCC, DDD) sl@0: sl@0: #endif sl@0: sl@0: sl@0: #endif