goat3d
diff src/log.cc @ 16:cb6c1a945a11
goat3d is starting to become functional inch by inch
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 26 Sep 2013 14:16:09 +0300 |
parents | |
children | 1d85d7dd0038 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/log.cc Thu Sep 26 14:16:09 2013 +0300 1.3 @@ -0,0 +1,20 @@ 1.4 +#include <stdio.h> 1.5 +#include <stdarg.h> 1.6 +#include "log.h" 1.7 + 1.8 +int goat_log_level = 256; 1.9 + 1.10 +void logmsg(int prio, const char *fmt, ...) 1.11 +{ 1.12 + fprintf(stderr, "goat3d error: "); 1.13 + 1.14 + va_list ap; 1.15 + 1.16 + if(prio < goat_log_level) { 1.17 + return; 1.18 + } 1.19 + 1.20 + va_start(ap, fmt); 1.21 + vfprintf(stderr, fmt, ap); 1.22 + va_end(ap); 1.23 +}