diff options
author | P. J. McDermott <pjm@nac.net> | 2013-02-14 18:03:09 (EST) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-02-14 18:03:09 (EST) |
commit | 80191b41352ad20493fb62e8f3683d69133d0d24 (patch) | |
tree | cb77e93dfe476d9535ca48e732a98aae9a780ba4 /src/logging.c | |
download | overworld-rpg-80191b41352ad20493fb62e8f3683d69133d0d24.zip overworld-rpg-80191b41352ad20493fb62e8f3683d69133d0d24.tar.gz overworld-rpg-80191b41352ad20493fb62e8f3683d69133d0d24.tar.bz2 |
Initial commit.
Diffstat (limited to 'src/logging.c')
-rw-r--r-- | src/logging.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/logging.c b/src/logging.c new file mode 100644 index 0000000..be03528 --- /dev/null +++ b/src/logging.c @@ -0,0 +1,43 @@ +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include "init.h" +#include "logging.h" + +void +debug(const char *fmt, ...) +{ + va_list ap; + + printf("Debug: "); + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + putchar('\n'); +} + +void +warn(const char *fmt, ...) +{ + va_list ap; + + printf("Warning: "); + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + putchar('\n'); +} + +void +err(int status, const char *fmt, ...) +{ + va_list ap; + + printf("Error: "); + va_start(ap, fmt); + vprintf(fmt, ap); + va_end(ap); + putchar('\n'); + + quit(status); +} |