first commit

This commit is contained in:
2026-01-12 11:49:49 -06:00
commit 0a07be9b42
7 changed files with 69 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
app
liblogger.a

17
LICENSE.md Normal file
View File

@@ -0,0 +1,17 @@
Copyright (C) 2026 Josh Wright
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.

31
Makefile Normal file
View File

@@ -0,0 +1,31 @@
TARGET = app
CXX = g++ -std=c++23 -ggdb -Wall -Wextra -pedantic -O0
INC = -I./include
LIB_PATH =
LIBS =
HEADERS = include/logger.hpp
SOURCES = src/logger.cpp \
main.cpp
STATIC = liblogger.a
all: $(TARGET)
$(TARGET): $(HEADERS) $(SOURCES)
@$(CXX) $(INC) $(LIB_PATH) $(SOURCES) -o $(TARGET) $(LIBS)
$(STATIC): include/logger.hpp src/logger.cpp
@g++ -std=c++23 -I./include -c src/logger.cpp -o logger.o
@ar rcs $(STATIC) logger.o
.PHONY: clean run lib
clean:
@rm -rf $(TARGET)
@rm -rf $(STATIC)
run: $(TARGET)
-@./$(TARGET)
@rm -rf $(TARGET)
lib: $(STATIC)
@rm -rf logger.o

3
README.md Normal file
View File

@@ -0,0 +1,3 @@
# Cpp Logger
This is a logger for cpp projects.

0
include/logger.hpp Normal file
View File

16
main.cpp Normal file
View File

@@ -0,0 +1,16 @@
#include <print>
#include "logger.hpp"
using std::println;
int main() {
Logger log;
log.addConsoleLogger();
log.addFileLogger("", "test_log.txt");
log.addDbLogger(DbType::SqlServer, "test_table");
log.info("Hello");
log.error("Oh no");
return 0;
}

0
src/logger.cpp Normal file
View File