Click here to Skip to main content
15,897,704 members
Articles / Containers / Virtual Machine

An extendable report editor

Rate me:
Please Sign up or sign in to vote.
5.00/5 (11 votes)
3 Sep 2008CPOL3 min read 41.3K   2K   35  
An extendable report editor. You can simply add your own controls without recompiling the program or writing annoying plug-ins.
#ifndef __SYSLOG_H
#define __SYSLOG_H

#include "common.h"

class CLog{
public:
	void *ptr;
	int (*puts)(char *str);
	int log_open_flag;
public:
	int Puts(char *str);
    CLog();
    ~CLog();
    int Init();
    int Destroy();
	static int DefPuts(char *str);
	int printf(char *szFormat, ...);
};

extern CLog syslog;

#define LOG syslog.printf
#define LOGS if(syslog.log_open_flag)LOG

#define PD(p) LOG("%s = %d\n",#p,p)
#define PX(p) LOG("%s = %x\n",#p,p)
#define PS(p) LOG("%s = %s\n",#p,p)
#define PF(p) LOG("%s = %f\n",#p,p)

#define PQ(p) {QWORD *_v_ = (QWORD*)&(p);LOG("%s = ",#p);LOG("%08x%08x\n",*((int*)_v_ + 1),(int)(*_v_));}

#endif

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
China China
26 years old, 2 years work experience.

Comments and Discussions