?? logtofile.h
字號(hào):
// LOGTOFILE.H//// Copyright (c) 1999-2003 PanSoftware Ltd. All rights reserved.//// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License version 2 as// published by the Free Software Foundation.#ifndef __LOGTOFILE_H__#define __LOGTOFILE_H__#include <e32std.h>////////////////////////////////////////////////////////////////////////////////// Functions appended with an 'F' will munge any %d chars// The WriteLog functions prepend the descriptor with a timestamp, threadId ...//// WriteDirect appends the descriptor directly onto the file// WriteDesF adds timestamp info and formats the incoming arguments into a descriptor// Most likely the descriptor is then later written to the file via WriteDirect// (Probably only ever going to be used by the CryptSys project).////////////////////////////////////////////////////////////////////////////////IMPORT_C void WriteLogF(const TDesC& aFileName, TRefByValue<const TDesC8> aFormat,VA_LIST aList);IMPORT_C void WriteLogF(const TDesC& aFileName, TRefByValue<const TDesC8> aFormat, ...);IMPORT_C void WriteLog(const TDesC& aFileName, const TDesC8&);IMPORT_C void WriteDirect(const TDesC& aFileName, const TDesC& aDes);IMPORT_C void WriteDesF(TDes& aDes,TRefByValue<const TDesC> aFmt, VA_LIST aList);IMPORT_C void WriteLogData(const TDesC& aFileName, const TDesC8& aFmt);IMPORT_C void WriteDesData(TDes& aBuffer, const TDesC8& aFmt);extern "C" IMPORT_C void WriteLogF(const char* aFileName, const char* aFormat, ...);extern "C" IMPORT_C void WriteLog(const char* aFileName, const char* aText);extern "C" IMPORT_C void SetLogging(TBool aStatus);////////////////////////////////////////////////////////////////////////////////// Convenience functions for threads that need control over when allocation// and destruction of Tls takes place in order to be able to use the// __UHEAP_xxx functions.////////////////////////////////////////////////////////////////////////////////IMPORT_C void WriteLogAllocTls();IMPORT_C void WriteLogDeallocTls();////////////////////////////////////////////////////////////////////////////////// Example usage/////////////////////////////////////////////////////////////////////////////////*#define _ENABLE_LOGGING_#if defined(_ENABLE_LOGGING_)#include <logtofile.h>#define LOG(TEXT) WriteLog(_L("Log"), TEXT)#define LOG1(TEXT,TEXT1) WriteLogF(_L("Log"), TEXT, TEXT1)#define LOG2(TEXT,TEXT1,TEXT2) WriteLogF(_L("Log"), TEXT, TEXT1, TEXT2)#define LOG3(TEXT,TEXT1,TEXT2,TEXT3) WriteLogF(_L("Log"), TEXT, TEXT1, TEXT2, TEXT3)#define LOG4(TEXT,TEXT1,TEXT2,TEXT3,TEXT4) WriteLogF(_L("Log"), TEXT, TEXT1, TEXT2, TEXT3, TEXT4)#define LOGENABLE(TEXT) SetLogging(TEXT)#define LOGDEALLOC() WriteLogDeallocTls();#else#define LOG(TEXT)#define LOG1(TEXT,TEXT1)#define LOG2(TEXT,TEXT1,TEXT2)#define LOG3(TEXT,TEXT1,TEXT2,TEXT3)#define LOG4(TEXT,TEXT1,TEXT2,TEXT3,TEXT4)#define LOGENABLE(TEXT)#define LOGDEALLOC()#endif*/#endif // __LOGTOFILE_H__
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -