toaruos/base/usr/include/toaru/trace.h
2018-03-19 11:38:11 +09:00

13 lines
312 B
C

#pragma once
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#ifndef TRACE
#define TRACE(msg,...) do { \
struct timeval t; gettimeofday(&t, NULL); \
fprintf(stderr, "%06d.%06d [" TRACE_APP_NAME "] %s:%05d - " msg "\n", t.tv_sec, t.tv_usec, __FILE__, __LINE__, ##__VA_ARGS__); \
} while (0)
#endif