1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
/****************************************************************************
*
* Copyright (c) 1996-2022 Vladi Belperchinov-Shabanski "Cade"
* http://cade.noxrun.com/ <cade@noxrun.com> <cade@bis.bg> <cade@cpan.org>
*
* SEE `README',`LICENSE' OR `COPYING' FILE FOR LICENSE AND OTHER DETAILS!
*
****************************************************************************/
#ifndef _DLOG_H_
#define _DLOG_H_
#include <stdio.h>
#define LOG( what ) log( __FILE__, __LINE__, what )
#define LOGN( what, n ) log( __FILE__, __LINE__, what, n )
class TLogFile
{
FILE *f;
char log_fn[255];
int keep_open;
public:
int on_stdout;
int on_stderr;
TLogFile();
~TLogFile();
void create( const char *fname, int pkeep_open );
void open();
void close();
void log( const char *fname, int line, const char *msg );
void log( const char *fname, int line, const char *msg, int n );
void log( const char *msg );
void log( const char *msg, int n );
void log( const char *msg, const char *arg );
};
#endif //_DLOG_H_
|