diff --git a/.travis.yml b/.travis.yml index 8cf9a9ae..6018b7f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -107,7 +107,7 @@ before_install: - which $CXX - which $CC - which valgrind - - if [ -n "$CLANG_VERSION" ]; then sudo CXX=$CXX CC=$CC .tests/install_libcxx.sh; fi + - if [ -n "$CLANG_VERSION" ]; then sudo CXX=$CXX CC=$CC ./tests/install_libcxx.sh; fi install: - cd $CHECKOUT_PATH @@ -136,7 +136,7 @@ install: script: - ./"${BIN}" - valgrind --trace-children=yes --leak-check=full ./"${BIN}" - - cd tests; make rebuild; ./tests + - cd $CHECKOUT_PATH/tests; make rebuild; ./tests notifications: email: false diff --git a/include/spdlog/details/line_logger.h b/include/spdlog/details/line_logger.h index 3a946cb6..80d7cc13 100644 --- a/include/spdlog/details/line_logger.h +++ b/include/spdlog/details/line_logger.h @@ -206,6 +206,11 @@ public: _enabled = false; } + bool is_enabled() const + { + return _enabled; + } + private: logger* _callback_logger; diff --git a/tests/Makefile b/tests/Makefile index fc428a9b..5be7be50 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,19 +1,20 @@ CXX ?= g++ -CXXFLAGS = -Wall -pedantic -std=c++11 -pthread -Wl,--no-as-needed -O2 -LDPFALGS = -pthread -flto +CXXFLAGS = -Wall -pedantic -std=c++11 -pthread -O2 +LDPFALGS = -pthread CPP_FILES := $(wildcard *.cpp) OBJ_FILES := $(addprefix ./,$(notdir $(CPP_FILES:.cpp=.o))) - -tests: $(OBJ_FILES) + +tests: $(OBJ_FILES) $(CXX) $(CXXFLAGS) $(LDPFALGS) -o $@ $^ + mkdir -p logs %.o: %.cpp - g++ $(CXXFLAGS) -c -o $@ $< + $(CXX) $(CXXFLAGS) -c -o $@ $< clean: - rm -f tests *.o logs/* + rm -f tests *.o logs/*.txt rebuild: clean tests