diff --git a/.gitignore b/.gitignore index cd42eac..1530978 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -Log.o \ No newline at end of file +*.o \ No newline at end of file diff --git a/Makefile b/Makefile index 3f99f42..03553b8 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,16 @@ TARGET = Log.o +TEST = test CFLAGS = -O2 -std=c++11 -Wall -Wextra -pedantic-errors -g .PHONY: all clean all: $(TARGET) +test: $(TARGET) $(TEST).o + $(CXX) -o test $^ + %.o: %.cpp $(CXX) -c -o $@ $(CFLAGS) $^ clean: - $(RM) $(TARGET) + $(RM) $(TARGET) $(TEST) $(TEST).o diff --git a/test.cpp b/test.cpp new file mode 100644 index 0000000..7d0976d --- /dev/null +++ b/test.cpp @@ -0,0 +1,19 @@ +#include "Log.h" + +int main() { + Log::init(); + Log::setColoredOutput(true); + + Log::fatal << "test: fatal"; + Log::error << "test: error"; + Log::warn << "test: warn"; + Log::note << "test: note"; + Log::info << "test: info"; + Log::debug << "test: debug"; + Log::trace << "test: trace"; + + Log::fatal << "test: fatal" << 2; + Log::error << "test: error" << 3 << '!'; + + // Log::stop(); +} \ No newline at end of file