aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-27 05:48:27 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-29 12:26:47 +0900
commit6f04aed67d68992c7b5c635b6c1f7aa83fdeb1b7 (patch)
tree1553f6f1513aad5d5c6c5518649cee12a3d38351
parent60d4a81092526f61fe8bcc7f5851ee6f343017fe (diff)
downloadkati-6f04aed67d68992c7b5c635b6c1f7aa83fdeb1b7.tar.gz
[C++] Do not log by default
-rw-r--r--Makefile3
-rw-r--r--log.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 77dbef4..8e0ed77 100644
--- a/Makefile
+++ b/Makefile
@@ -38,7 +38,8 @@ CXX_OBJS:=$(CXX_SRCS:.cc=.o)
CXX_TEST_OBJS:=$(CXX_TEST_SRCS:.cc=.o)
CXX_ALL_OBJS:=$(CXX_SRCS:.cc=.o) $(CXX_TEST_SRCS:.cc=.o)
CXX_TEST_EXES:=$(CXX_TEST_OBJS:.o=)
-CXXFLAGS:=-g -W -Wall -MMD # -O
+CXXFLAGS:=-g -W -Wall -MMD
+CXXFLAGS+=-O -DNOLOG
all: kati para ckati $(CXX_TEST_EXES)
diff --git a/log.h b/log.h
index bc1cf1e..ee16a21 100644
--- a/log.h
+++ b/log.h
@@ -22,9 +22,13 @@
#include "stringprintf.h"
+#ifdef NOLOG
+#define LOG(args...)
+#else
#define LOG(args...) do { \
fprintf(stderr, "*kati*: %s\n", StringPrintf(args).c_str()); \
} while(0)
+#endif
#define PERROR(...) do { \
fprintf(stderr, "%s: %s\n", StringPrintf(__VA_ARGS__).c_str(), \