⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 outputlog.h

📁 程序开发中写log用的实现代码, C语言代码, 可以不用修改再C++或MFC中使用, 可以将写log的函数使用方法同printf, 可以接收可变参数. 对于开发程序很有帮助.
💻 H
字号:

#ifndef _OUTPUTLOG_H_
#define _OUTPUTLOG_H_

#ifdef __cplusplus
extern "C" 
{
#endif /* __cplusplus */

/*-------------------------------------------------------------------
Includes and variable definitions
-------------------------------------------------------------------*/
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>

typedef unsigned char boolean;
typedef unsigned char byte;

#ifndef PUBLIC
#define PUBLIC
#endif

#define  LOG_INIT(log_path)     InitFile(log_path)
#define  LOG_CLOSE              CloseFile
#define  WRITE_TO_LOG           TIEM_FILE_LINE(__FILE__, __LINE__); WriteToLog
#define  WRITE_TO_LOG_HEX		TIEM_FILE_LINE(__FILE__, __LINE__); WriteToLogHex

/*-------------------------------------------------------------------
Function Prototypes
-------------------------------------------------------------------*/
PUBLIC  void InitFile(const char *pcFilePath);
PUBLIC  void CloseFile(void);
PUBLIC  void TIEM_FILE_LINE(const char *pcFileStr, int nLineNumber);
PUBLIC  boolean WriteToLog(const char *pcFormat, ...);
PUBLIC  boolean WriteToLogHex(const void *pcBuffer, int nSize);
PUBLIC  boolean WriteToLogNone(const char *pcFormat, ...);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* _OUTPUTLOG_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -