goldendict-ng/gddebug.hh
Igor Kushnir 1d6b5efeac Disable GD_DPRINTF() output in Release builds on all systems
Messages printed with GD_DPRINTF() are clearly debug messages. They
flood GoldenDict's output with lines like these:
    some body finished
    one finished.
    erasing..
    erase done..
    one not finished.
    ====reading 16384 bytes

Messages printed to stderr with GD_FDPRINTF() are more important and
less frequent => leave them in Release builds.
2022-11-04 21:01:52 +03:00

33 lines
739 B
C++

#ifndef __GDDEBUG_HH_INCLUDED__
#define __GDDEBUG_HH_INCLUDED__
#include <QFile>
#ifdef NO_CONSOLE
#define GD_DPRINTF(...) do {} while( 0 )
#define GD_FDPRINTF(...) do {} while( 0 )
#else
#ifdef NO_GD_DPRINTF
#define GD_DPRINTF(...) do {} while( 0 )
#else
#define GD_DPRINTF(...) printf(__VA_ARGS__)
#endif
#define GD_FDPRINTF(...) fprintf(__VA_ARGS__)
#endif
void gdWarning(const char *, ...) /* print warning message */
#if defined(Q_CC_GNU) && !defined(__INSURE__)
__attribute__ ((format (printf, 1, 2)))
#endif
;
void gdDebug(const char *, ...)
#if defined(Q_CC_GNU) && !defined(__INSURE__)
__attribute__ ((format (printf, 1, 2)))
#endif
;
extern QFile * logFilePtr;
#endif // __GDDEBUG_HH_INCLUDED__