libwupsbackend/source/logger.h
2022-07-24 13:10:39 -07:00

16 lines
772 B
C

#pragma once
#include <coreinit/debug.h>
#include <cstring>
#define __FILENAME__ ({ \
const char *filename = __FILE__; \
const char *pos = strrchr(filename, '/'); \
if (!pos) pos = strrchr(filename, '\\'); \
pos ? pos + 1 : filename; \
})
#define DEBUG_FUNCTION_LINE_ERR(FMT, ARGS...) \
do { \
OSReport("[(%s)%18s][%23s]%30s@L%04d: ## ERROR ## " FMT "\n", "M", "libwupsbackend", __FILENAME__, __FUNCTION__, __LINE__, ##ARGS); \
} while (0)