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

📄 debug.h

📁 PPP服务端实现例子
💻 H
字号:
//Debug.h - Generic debug information output engine
//Robert Merrison - 2001

#ifndef _DEBUG_H_
#define _DEBUG_H_

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

class time_engine;

enum { DBLEVEL_LOW = 1, DBLEVEL_MED, DBLEVEL_HIGH };
enum { MSG_NOTICE = 1, MSG_STATUS, MSG_ERROR, MSG_CRITICAL };

class	debug_engine{
public:
	debug_engine( );
	~debug_engine( );
	
	bool	init( short debug_level = DBLEVEL_MED, char* debug_filename = NULL, time_engine* timer_engine = NULL );
	bool	kill( );
	bool	log_message( short msg_type, char* message, ... );
	void	check_file_size();


private:
	int		bytes_written;	//Number of kb of data written to debug file
	
	char	filename[256];
	
	short	file_size_limit;
	short	level;
	
	FILE*	debug_file;

	time_engine*	timer;

	bool	open_debug_file( char* debug_filename ); 
	bool	must_log( short msg_type );
	bool	is_inited;
	bool	write_file;
	bool	log_time;
};

#endif

⌨️ 快捷键说明

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