allow for log flushing
This commit is contained in:
parent
c5274a56b8
commit
feac7be191
10
Log.cpp
10
Log.cpp
|
@ -15,6 +15,13 @@
|
|||
#include <QString>
|
||||
#endif
|
||||
|
||||
#if LOG_ENABLEFLUSH == 1
|
||||
#define FLUSH_COMMAND std::endl
|
||||
#else
|
||||
// dont flush
|
||||
#define FLUSH_COMMAND '\n'
|
||||
#endif
|
||||
|
||||
namespace Log {
|
||||
|
||||
#if LOG_ENABLEQT == 1
|
||||
|
@ -54,8 +61,7 @@ public:
|
|||
|
||||
std::ostream* os = getOs(lvl);
|
||||
if (os) {
|
||||
*os << sbuf;
|
||||
os->put('\n');
|
||||
*os << sbuf << FLUSH_COMMAND;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
3
Makefile
3
Makefile
|
@ -2,7 +2,8 @@ TARGET = Log.o
|
|||
TEST = test
|
||||
LOG_USEMUTEX ?= 0
|
||||
LOG_ENABLEQT ?= 0
|
||||
CXXFLAGS = -O2 -g -std=c++11 -Wall -Wextra -pedantic-errors -MMD -DLOG_USEMUTEX=$(LOG_USEMUTEX) -DLOG_ENABLEQT=$(LOG_ENABLEQT)
|
||||
LOG_ENABLEFLUSH ?= 0
|
||||
CXXFLAGS = -O2 -g -std=c++11 -Wall -Wextra -pedantic-errors -MMD -DLOG_USEMUTEX=$(LOG_USEMUTEX) -DLOG_ENABLEQT=$(LOG_ENABLEQT) -DLOG_ENABLEFLUSH=$(LOG_ENABLEFLUSH)
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
|
|
Loading…
Reference in New Issue