diff options
Diffstat (limited to 'logging.h')
| -rw-r--r-- | logging.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/logging.h b/logging.h new file mode 100644 index 0000000..6ad5729 --- /dev/null +++ b/logging.h @@ -0,0 +1,29 @@ +#include <stdarg.h> +#include <unistd.h> + +static void +aura_printf(const char *fmt, ...) +{ + va_list args = { 0 }; + + printf("[%d] ", getpid()); + va_start(args, fmt); + vprintf(fmt, args); + va_end(args); + + return; +} + +static void +aura_fprintf(FILE *stream, const char *fmt, ...) +{ + va_list args = { 0 }; + + fprintf(stream, "[%d] ", getpid()); + va_start(args, fmt); + vfprintf(stream, fmt, args); + va_end(args); + + return; +} + |
