#pragma once
#include <stdio.h>
#include <stdarg.h>

//#ifdef DEBUG
enum LogLevel { LOG_OK, LOG_FAIL, LOG_WARN, LOG_INFO, LOG_LUART, LOG_LUALD, LOG_VERBOSE, LOG_UNSALTED };

static inline void log_msg(enum LogLevel level, const char *fmt, ...) {
    va_list args;
    va_start(args, fmt);

    switch (level) {
        case LOG_OK:   printf("[\033[1;32m OK \033[0m] "); break;
        case LOG_FAIL: printf("[\033[1;31mFAIL\033[0m] "); break;
        case LOG_WARN: printf("[\033[1;33mWARN\033[0m] "); break;
        case LOG_INFO: printf("[\033[1;34mINFO\033[0m] "); break;
        case LOG_LUART:  printf("[\033[1;35mLUA RUNTIME ERROR\033[0m] "); break;
        case LOG_LUALD:  printf("[\033[1;35mLUA LOADING ERROR\033[0m] "); break;
        case LOG_VERBOSE: printf("  - "); break;
        case LOG_UNSALTED: break;
    }
    vprintf(fmt, args);
    va_end(args);
}
//#else
//#define log_msg(...) ((void)0)
//#endif