class logfileexcept : public except
{
public:
	logfileexcept(const char *szdesc=0):except("File exception",szdesc){};
	~logfileexcept(){};
};

class logfile : public filewrapper
{
	char		_block[BLOCKSIZE];
	int			_size;


public:
	logfile();
	~logfile();

	void append_entry(const char *);

};

logfile::logfile()
{
	_size =0;
	memset(_block,0,BLOCKSIZE);
}

logfile::~logfile()
{
	append(_block,_size+1);
}

void logfile::append_entry(const char *szentry)
{
	if ( strlen(szentry) + _size >= BLOCKSIZE-3 ) //2 for \r\n plus 1 for \0
	{
		append(_block,_size+1);
		memset(_block,0,BLOCKSIZE);
		_size = 0;
	}


	strcat(_block,szentry);
	strcat(_block,"\r\n");
	_size = strlen(_block);
}