1.1 --- a/epoc32/include/push/pushlog.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,161 +0,0 @@
1.4 -// Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 -// All rights reserved.
1.6 -// This component and the accompanying materials are made available
1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 -// which accompanies this distribution, and is available
1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.10 -//
1.11 -// Initial Contributors:
1.12 -// Nokia Corporation - initial contribution.
1.13 -//
1.14 -// Contributors:
1.15 -//
1.16 -// Description:
1.17 -//
1.18 -
1.19 -
1.20 -
1.21 -/**
1.22 - @file
1.23 - @publishedPartner
1.24 - @released
1.25 -*/
1.26 -
1.27 -#ifndef __PUSHLOG_H__
1.28 -#define __PUSHLOG_H__
1.29 -
1.30 -
1.31 -/**
1.32 -Logs a literal string specified in a, assuming iLog is an MWapPushLog object.
1.33 -*/
1.34 -#define __LOG_ALWAYS(a) {_LIT(name,a); iLog.WPLPrintf(name);}
1.35 -
1.36 -/**
1.37 -Logs a literal string specified in a, assuming iLog is a pointer to a MWapPushLog
1.38 -object.
1.39 -*/
1.40 -#define __LOG_PTR_ALWAYS(a) {_LIT(name,a); if(iLog) iLog->WPLPrintf(name);}
1.41 -
1.42 -/**
1.43 -Logs a literal string specified in a, assuming aLog is a MWapPushLog object.
1.44 -*/
1.45 -#define __LOG_PAR_ALWAYS(a) {_LIT(name,a); aLog.WPLPrintf(name);}
1.46 -
1.47 -/**
1.48 -Logs an error descriptor and integer error code specified in name and a respectively,
1.49 -assuming iLog is a MWapPushLog object.
1.50 -*/
1.51 -#define __LOG_ERROR_ALWAYS(a,b) {_LIT(name,a); iLog.WPLLogError(name,b);}
1.52 -
1.53 -
1.54 -#if defined(_DEBUG)
1.55 -/**
1.56 -Logs, in debug builds only, a literal string specified in a, assuming iLog
1.57 -is an MWapPushLog object.
1.58 -*/
1.59 -#define __LOG_DEBUG(a) __LOG_ALWAYS(a)
1.60 -
1.61 -/**
1.62 -Logs, in debug builds only, a literal string specified in a, assuming iLog
1.63 -is a pointer to a MWapPushLog object.
1.64 -*/
1.65 -#define __LOG_PTR_DEBUG(a) __LOG_PTR_ALWAYS(a)
1.66 -
1.67 -/**
1.68 -Logs, in debug builds only, a literal string specified in a, assuming aLog
1.69 -is a MWapPushLog object.
1.70 -*/
1.71 -#define __LOG_PAR_DEBUG(a) __LOG_PAR_ALWAYS(a)
1.72 -
1.73 -/**
1.74 -Logs, in debug builds only, a CPushMessage specified in a, assuming iLog is
1.75 -an MWapPushLog object.
1.76 -*/
1.77 -#define __LOG_MSG_DEBUG(a) iLog.WPLPrintfL(a)
1.78 -
1.79 -/**
1.80 -Logs, in debug builds only, an error descriptor and integer error code specified
1.81 -in name and a respectively, assuming iLog is a MWapPushLog object.
1.82 -*/
1.83 -#define __LOG_ERROR_DEBUG(a,b) __LOG_ERROR_ALWAYS(a,b)
1.84 -#else
1.85 -/** Logs always. iLog is an MWapPushLog object*/
1.86 -#define __LOG_DEBUG(a)
1.87 -/** Logs always. iLog is an MWapPushLog pointer*/
1.88 -#define __LOG_PTR_DEBUG(a)
1.89 -/** Logs always. iLog is an MWapPushLog object*/
1.90 -#define __LOG_PAR_DEBUG(a)
1.91 -/** Logs always. iLog is CPushMessage specified in MWapPushLog object*/
1.92 -#define __LOG_MSG_DEBUG(a)
1.93 -/** Logs error in debug mode */
1.94 -#define __LOG_ERROR_DEBUG(a,b)
1.95 -
1.96 -
1.97 -#endif
1.98 -
1.99 -
1.100 -class CPushMessage;
1.101 -
1.102 -
1.103 -/**
1.104 -Abstract WAP Push log access interface: logging is primarily for debugging.
1.105 -
1.106 -The standard Symbian OS WAP Push watcher component writes to a log at c:\\logs\\watcher\\watcher.txt
1.107 -if the c:\\logs\\watcher\\ directory exists. It supplies this interface to push
1.108 -plug-ins through CPushHandlerBase::SetLogger(). The plug-in can then call
1.109 -the interface's functions to add its own messages to the log.
1.110 -
1.111 -@publishedPartner
1.112 -@released
1.113 -*/
1.114 -class MWapPushLog
1.115 - {
1.116 -public:
1.117 - /**
1.118 - Writes a string to the log.
1.119 -
1.120 - @param aDescription
1.121 - String to log
1.122 - */
1.123 - virtual void WPLPrintf(const TDesC& aDescription)=0;
1.124 -
1.125 - /**
1.126 - Writes a push message to the log.
1.127 -
1.128 - It writes the message's content-type, date, expiry, and application-ID headers
1.129 - as text, and the complete headers and message body in binary form.
1.130 -
1.131 - @param aMessage
1.132 - Push message to log
1.133 - */
1.134 - virtual void WPLPrintfL(CPushMessage& aMessage)=0;
1.135 -
1.136 - /**
1.137 - Writes a binary buffer to the log.
1.138 -
1.139 - The buffer is written as six hexadecimal bytes per line: e.g.
1.140 -
1.141 - @code
1.142 - AB CD 01 12 34 A2
1.143 - FF 00 AB CD 12 DE
1.144 - @endcode
1.145 -
1.146 - @param aDescription
1.147 - Binary buffer to log
1.148 - */
1.149 - virtual void WPLLogBinaryAsHex(const TDesC& aDescription)=0;
1.150 -
1.151 - /**
1.152 - Writes an error message and code to the log.
1.153 -
1.154 - @param aDescription
1.155 - Error message
1.156 -
1.157 - @param aError
1.158 - Error code
1.159 - */
1.160 - virtual void WPLLogError(const TDesC& aDescription,TInt aError)=0;
1.161 - };
1.162 -
1.163 -
1.164 -#endif