Telephony/ctsydispatchlayer/exportinc/ltsylogger.h
author Arnaud Lenoir
Tue, 05 Oct 2010 14:48:01 +0100
changeset 26 0cdfb9e7f8e5
parent 21 ab1d0f4d2aa4
permissions -rw-r--r--
FYI - READ ONLY - Updated SHAI_public_APIs-status.xlsx. contact arnaudl@symbian.org for any changes you want.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     7
//
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    10
//
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    11
// Contributors:
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    12
//
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    13
// Description:
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    14
// CommsDebugUtil logging support for the CTSY Dispatcher.
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    15
//
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    16
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    17
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    18
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    19
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    20
/**
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    21
 @file
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    22
 @internalAll 
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    23
*/
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    24
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    25
#ifndef __LTSYLOGGER_H_
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    26
#define __LTSYLOGGER_H_
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    27
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    28
#include <e32base.h>
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    29
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    30
#ifdef OST_TRACE_COMPILER_IN_USE
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    31
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    32
_LIT8(KTsySubSystem, "tsy");
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    33
_LIT8(KTsyCompnt, "ctsydis");
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    34
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    35
	/** Macros to log function entry and exit */
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    36
	//#define TSYLOGENTRYEXIT(aFunc) 	TLogEntryExit __logger((aFunc), KTsyCompnt)
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    37
	
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    38
	//#define TSYLOGENTRYEXITARGS(aFunc, aFmt, ARGS...) 	TLogEntryExit __logger((aFunc), KTsyCompnt, (aFmt), ##ARGS); 
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    39
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    40
	#define TSYLOGENTRYEXIT 	/*lint -save -e40*/	TLogEntryExit __logger(TPtrC8((const TUint8*)__PRETTY_FUNCTION__), KTsyCompnt)/*lint -restore*/
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    41
	
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    42
	// N.B. The function name does not need to be specified
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    43
	#define TSYLOGENTRYEXITARGS(aFmt, ARGS...) 	/*lint -save -e40*/ TLogEntryExit __logger(TPtrC8((const TUint8*)__PRETTY_FUNCTION__), KTsyCompnt, (aFmt), ##ARGS)/*lint -restore*/
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    44
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    45
	#define TSYLOGSETEXITERR(aErr) 	__logger.SetExitErrorCode( aErr )
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    46
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    47
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    48
/**
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    49
Automatic class that logs function entry and exit
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    50
*/
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    51
class TLogEntryExit
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    52
	{
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    53
public:
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    54
	IMPORT_C TLogEntryExit(const TDesC8& aFnName, const TDesC8& aLayer);
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    55
	IMPORT_C TLogEntryExit(const TDesC8& aFnName, const TDesC8& aLayer, TRefByValue<const TDesC8> aFmt, ...);
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    56
	IMPORT_C TLogEntryExit(const TDesC8& aFnName, const TDesC8& aLayer, TRefByValue<const TDesC16> aFmt, ...);
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    57
	IMPORT_C ~TLogEntryExit();
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    58
	inline TInt SetExitErrorCode(TInt aErr);
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    59
private:
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    60
	TPtrC8 iFnName;
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    61
	TPtrC8 iLayer;
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    62
	TInt   iErr;
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    63
	}; // class TLogEntryExit
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    64
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    65
/** 
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    66
Set the error that will be logged at function exit
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    67
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    68
@param aErr error code to log
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    69
@return the given error code. This is to allow to pipe the function call
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    70
*/
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    71
TInt TLogEntryExit::SetExitErrorCode(TInt aErr)
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    72
	{
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    73
	return iErr = aErr;
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    74
	}
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    75
	
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    76
	
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    77
	
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    78
#else // _DEBUG
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    79
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    80
	#define TSYLOGENTRYEXIT
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    81
	#define TSYLOGENTRYEXITARGS(aFunc, aFmt, ARGS...)
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    82
	#define TSYLOGSETEXITERR(aErr)	aErr // So that we don't lose the return code in UREL!
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    83
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    84
	
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    85
/**
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    86
Stub class for urel builds, required for exports.
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    87
*/
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    88
class TLogEntryExit
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    89
	{
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    90
public:
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    91
	IMPORT_C TLogEntryExit(const TDesC8& aFnName, const TDesC8& aLayer);
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    92
	IMPORT_C TLogEntryExit(const TDesC8& aFnName, const TDesC8& aLayer, TRefByValue<const TDesC8> aFmt, ...);
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    93
	IMPORT_C TLogEntryExit(const TDesC8& aFnName, const TDesC8& aLayer, TRefByValue<const TDesC16> aFmt, ...);
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    94
	IMPORT_C ~TLogEntryExit();
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    95
	};
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    96
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    97
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    98
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
    99
#endif // _DEBUG
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   100
ab1d0f4d2aa4 Adding the "WishList" state Telephony APIs
Tom Pritchard <tomp@symbian.org>
parents:
diff changeset
   101
#endif // __LTSYLOGGER_H_