Skip to content

Instantly share code, notes, and snippets.

@techie-guy
techie-guy / logger.c
Last active March 27, 2023 17:42
Simple, Colorful Logging in C/C++
#include <stdio.h>
// Color Codes taken from https://gist.github.com/iamnewton/8754917
#define COLOR_RESET "\e[0m"
#define COLOR_RED "\e[0;31m"
#define COLOR_GREEN "\e[0;32m"
#define COLOR_YELLOW "\e[0;33m"
#define COLOR_BLUE "\e[0;34m"
#define COLOR_WHITE "\e[0;37m"
#define COLOR_BOLD_RED "\e[1;31m"
CC=clang
CFLAGS=-c -Wall -I
LDFLAGS=
SOURCES=$(wildcard *.c)
OBJECTS=$(SOURCES:%.c=obj/%.o)
EXECUTABLE=app
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)