messagingfw/wappushfw/pushwatcher/test/testlog.h
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2000-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 __TESTLOG_H__
       
    17 #define __TESTLOG_H__
       
    18 
       
    19 
       
    20 #include <push/pushlog.h>
       
    21 
       
    22 /**
       
    23  * CWapPushLog
       
    24  *	A logging utility, primarily for debugging.  
       
    25  *  If  c:\logs\push\ is on the device, a log file will be created.
       
    26  *  The log will also be displayed to the console.  
       
    27  *	This is useful for debugging UI less CActive objects.
       
    28  *		
       
    29  */
       
    30 class CWapPushLog : public CBase, public MWapPushLog
       
    31 	{
       
    32 public:
       
    33 	static CWapPushLog* NewL(CConsoleBase& aConsole);
       
    34 	~CWapPushLog();
       
    35 
       
    36 	// Set the filename, default is KPushLogFile
       
    37 	void SetLogFileName(const TFileName aFilename);
       
    38 	const TDesC& LogFileName() const;
       
    39 
       
    40 public:
       
    41 	//from MWapPushLog
       
    42 	virtual void WPLPrintf(const TDesC& aDescription);
       
    43 	virtual void WPLPrintfL(CPushMessage& aMessage);
       
    44 	virtual void WPLLogBinaryAsHex(const TDesC& aDescription);
       
    45 	virtual void WPLLogError(const TDesC& aDescription,TInt aError);
       
    46 
       
    47 protected:
       
    48 	void ConstructL();
       
    49 	CWapPushLog(CConsoleBase& aConsole);
       
    50 
       
    51 private:
       
    52 	TFileName	iLogFilename;
       
    53 	CConsoleBase& iConsole;
       
    54 	};
       
    55 #endif