2026-03-31 19:42:54 +01:00

39 lines
859 B
C

#ifndef LOGGER_H_INCLUDED
#define LOGGER_H_INCLUDED
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifdef _WIN32
#include <direct.h>
#include <windows.h>
#define MKDIR(path) _mkdir(path)
#else
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#define MKDIR(path) mkdir(path, 0777)
#endif
#define LOG_LEVEL_INFO (1 << 0)
#define LOG_LEVEL_WARN (1 << 1)
#define LOG_LEVEL_ERROR (1 << 2)
#define LOG_LEVEL_SUCCESS (1 << 3)
#define LOG_COLOR_OUT (1 << 4)
#define LOG_ONLY_ERROR (1 << 5)
#define LOG_FILE (1 << 6)
#define LOG_TIME_STAMP (1 << 7)
#define COLOR_RED "\x1b[31m"
#define COLOR_GREEN "\x1b[32m"
#define COLOR_YELLOW "\x1b[33m"
#define COLOR_BLUE "\x1b[34m"
#define COLOR_RESET "\x1b[0m"
unsigned int flogf(unsigned short flags, const char *Format, ...);
#endif // LOGGER_H_INCLUDED