mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-16 21:25:46 +01:00
make debug loggers not be needlessly abbreviated.
This commit is contained in:
10
src/error.c
10
src/error.c
@@ -13,35 +13,35 @@ static void error_log(FILE *restrict stream, const char *restrict pfx, uint ln,
|
|||||||
fprintf(stream, "'\n");
|
fprintf(stream, "'\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void error_dbg(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
void error_debug(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
error_log(stdout, "\033[95mDBG\033[0m", ln, file, fmt, ap);
|
error_log(stdout, "\033[95mDBG\033[0m", ln, file, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void error_inf(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
void error_info(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
error_log(stdout, "\033[94mINF\033[0m", ln, file, fmt, ap);
|
error_log(stdout, "\033[94mINF\033[0m", ln, file, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void error_war(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
void error_warn(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
error_log(stdout, "\033[93mWAR\033[0m", ln, file, fmt, ap);
|
error_log(stdout, "\033[93mWAR\033[0m", ln, file, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void error_err(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
void error_error(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
error_log(stdout, "\033[91mERR\033[0m", ln, file, fmt, ap);
|
error_log(stdout, "\033[91mERR\033[0m", ln, file, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void error_fat(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
void error_fatal(uint ln, const char *restrict file, const char *restrict fmt, ...) {
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
error_log(stdout, "\033[101mFAT\033[0m", ln, file, fmt, ap);
|
error_log(stdout, "\033[101mFAT\033[0m", ln, file, fmt, ap);
|
||||||
|
|||||||
20
src/error.h
20
src/error.h
@@ -9,14 +9,14 @@
|
|||||||
#include "util/intdef.h"
|
#include "util/intdef.h"
|
||||||
#include "util/macro.h"
|
#include "util/macro.h"
|
||||||
|
|
||||||
void error_dbg(uint ln, const char *restrict file, const char *restrict fmt, ...);
|
void error_debug(uint ln, const char *restrict file, const char *restrict fmt, ...);
|
||||||
void error_inf(uint ln, const char *restrict file, const char *restrict fmt, ...);
|
void error_info(uint ln, const char *restrict file, const char *restrict fmt, ...);
|
||||||
void error_war(uint ln, const char *restrict file, const char *restrict fmt, ...);
|
void error_warn(uint ln, const char *restrict file, const char *restrict fmt, ...);
|
||||||
void error_err(uint ln, const char *restrict file, const char *restrict fmt, ...);
|
void error_error(uint ln, const char *restrict file, const char *restrict fmt, ...);
|
||||||
void error_fat(uint ln, const char *restrict file, const char *restrict fmt, ...) NORET;
|
void error_fatal(uint ln, const char *restrict file, const char *restrict fmt, ...) NORET;
|
||||||
|
|
||||||
#define debug(...) error_dbg(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
#define debug(...) error_debug(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
||||||
#define info(...) error_inf(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
#define info(...) error_info(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
||||||
#define warn(...) error_war(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
#define warn(...) error_warn(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
||||||
#define error(...) error_err(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
#define error(...) error_error(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
||||||
#define fatal(...) error_fat(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
#define fatal(...) error_fatal(__LINE__, __FILE__ __VA_OPT__(, ) __VA_ARGS__)
|
||||||
|
|||||||
Reference in New Issue
Block a user