25 #error logging.h is only for C++! 38 #define DBG_LOG(channel) if (gDbgLog.configured(channel, __FILE__, __LINE__)) gDbgLog 39 #define ERR_LOG(channel) if (gErrLog.configured(channel, __FILE__, __LINE__)) gErrLog 40 #define ONL_LOG(channel) if (gOnlLog.configured(channel, __FILE__, __LINE__)) gOnlLog 43 typedef void (*funcp)(void);
120 Log(
const string& fname =
"",
123 const string& toLog =
"",
124 const string& progName =
"Unknown",
125 const string& version =
"Vx.x");
127 int init(
const string& fname,
130 const string& fileToLog,
131 const string& progName,
132 const string& version);
133 ofstream* getFstreamP() {
return mFstreamP; }
134 int getConfChannels()
const {
return mConfChannels; }
136 void setConfChannels(
int chans) { mConfChannels = chans; }
137 static string getDate();
138 static string getTime();
139 static string channelsToStr(
int channels);
140 static int strToChannels(
const string& str);
141 bool configured(
int channels,
const char* file,
int line);
142 ios::fmtflags setf(ios::fmtflags format) {
return mFstreamP->setf(format); }
173 if (log.getFstreamP() ) *log.getFstreamP() << out;
174 if (log.getConfChannels() &
cns) cout << out;
ofstream * mFstreamP
Filestream der Datei.
Definition: logging.h:110
"High" - wichtige Ausgaben
Definition: logging.h:54
"Memory" - Speicherverwaltung
Definition: logging.h:52
bool mIsSuppressed
Ausgabe unterdrueckt.
Definition: logging.h:114
string mFileToLog
Name der Quelltextdatei, die als einzige geloggt wird.
Definition: logging.h:112
int mMaxLogLen
maximale Laenge der Log-Dateien in Byte
Definition: logging.h:113
"Control" - Kontrollfluss
Definition: logging.h:51
"Medium" - normale Ausgaben
Definition: logging.h:55
"General" - allgemeine Ausgaben
Definition: logging.h:53
"Console" - Ausgaben zusaetzlich auf Konsole
Definition: logging.h:58
string mProgName
Name des Programms (fuer Titelzeile der Log-Datei)
Definition: logging.h:115
string mFname
Name d. Datei, in die geloggt wird ("" = Konsole)
Definition: logging.h:109
Klasse zum Loggen von Laufzeitausgaben in eine Datei.
Definition: logging.h:107
Log & operator<<(Log &log, const T &out)
Globales Funktions-Template.
Definition: logging.h:171
string mVersion
Version des Programms (fuer Titelzeile der Log-Datei)
Definition: logging.h:116
int mConfChannels
Kanaele, die konfiguriert sind (z. B. per Ini-Datei)
Definition: logging.h:111
"Low" - unwichtige Ausgaben
Definition: logging.h:56