sl@0: /* sl@0: * Copyright (c) 2006-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: Contained MRT library code tracing macros and class definition. sl@0: * sl@0: */ sl@0: sl@0: sl@0: #ifndef LIB_LOGGER_HANDLER_H sl@0: #define LIB_LOGGER_HANDLER_H sl@0: sl@0: // INCLUDES sl@0: #include sl@0: #include "liblogger.h" sl@0: sl@0: // FORWARD DECLARATIONS sl@0: class RFile; sl@0: class RFs; sl@0: sl@0: // FORWARD DECLARATIONS sl@0: /* sl@0: * Here, we are providing all utility functions that will be sl@0: * used by all modules. We are expecting that all codes specific sl@0: * to symbian will use active object for asynchronous handling sl@0: * of all their functionalities. In case of thread provide sl@0: * synchnorization for accessing the shared objects. sl@0: */ sl@0: sl@0: NONSHARABLE_CLASS ( CLibLogger ) sl@0: { sl@0: private: sl@0: /* sl@0: * create one session with file server sl@0: */ sl@0: static int CreateFileSession(RFs &aFsSession, RFile &aFile); sl@0: sl@0: /* sl@0: * create one session with file server sl@0: */ sl@0: static void GetLogFilename(TDes& aFileName); sl@0: sl@0: /* sl@0: * Write message to the log file sl@0: */ sl@0: static TInt WriteMessage(const TDesC8& aMessage); sl@0: sl@0: /* sl@0: * Default constructor sl@0: */ sl@0: CLibLogger() {} sl@0: sl@0: /* all the methods within this class are public and static. */ sl@0: public: sl@0: /* logging related */ sl@0: sl@0: /* sl@0: * Message logging interface sl@0: */ sl@0: static int LogMessage(TLibTraceMessageType aLogMessageType, sl@0: char *aFileName, sl@0: int aLine, sl@0: char *aFormat, sl@0: VA_LIST& aMarkerList); sl@0: sl@0: /* sl@0: * Only filename and line number with timestamp. sl@0: */ sl@0: static int LogMessage(char *aFileName, int aLine); sl@0: sl@0: /* sl@0: * Only message without timestamp sl@0: */ sl@0: static int LogMessage(TLibTraceMessageType aLogMessageType, sl@0: char *aFormat, sl@0: VA_LIST& aMarkerList); sl@0: sl@0: /* sl@0: * dumping the message in hex format sl@0: */ sl@0: static int DumpMessage(TLibTraceMessageType aLogMessageType, sl@0: char *aFileName, sl@0: int aLine, sl@0: char* aMessage, sl@0: char *aStr, sl@0: int aStrLen = -1); sl@0: sl@0: /* sl@0: * dumping the message in hex format sl@0: */ sl@0: static int DumpMessage(char *aStr, int aStrLen); sl@0: sl@0: /* sl@0: * dumping the message in hex format sl@0: */ sl@0: static int DumpFormatMessage(TLibTraceMessageType aLogMessageType, sl@0: char *aFileName, sl@0: int aLine, sl@0: char *aMessage, sl@0: char *aFormat, sl@0: VA_LIST& aMarkerList); sl@0: /* sl@0: * dumping the message in hex format sl@0: */ sl@0: static int DumpFormatMessage(TLibTraceMessageType aLogMessageType, sl@0: char *aMessage, sl@0: char *aFormat, sl@0: VA_LIST& aMarkerList); sl@0: }; sl@0: sl@0: #endif //LIBC_LOGGER_HANDLER_H sl@0: sl@0: sl@0: // End of file