Add log framework
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#include "log.h"
|
||||
#include <stdio.h>
|
||||
|
||||
static LogError* s_logError = NULL;
|
||||
|
||||
void log_set_output(LogError* destination) {
|
||||
s_logError = destination;
|
||||
}
|
||||
|
||||
void log_error(const char* msg) {
|
||||
if (s_logError != NULL) {
|
||||
s_logError(msg);
|
||||
} else {
|
||||
fprintf(stderr, "Error: %s\n", msg);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user