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