Files
scuffedcraft/src/log.c
2026-07-03 22:07:03 +03:00

18 lines
518 B
C

#include <stddef.h>
#include <stdio.h>
#include <stdarg.h>
void log_with_tag(FILE* out_file, char* file_name, size_t line, const char* tag, char* str) {
fprintf(out_file, "[%s] %s:%zu: %s\n", tag, file_name, line, str);
}
void logf_with_tag(FILE* out_file, char* file_name, size_t line, const char* tag, char* fmt, ...) {
fprintf(out_file, "[%s] %s:%zu: ", tag, file_name, line);
va_list args;
va_start(args, fmt);
vfprintf(out_file, fmt, args);
va_end(args);
fprintf(out_file, "\n");
}