toaruos/base/usr/include/toaru/trace.h

13 lines
312 B
C
Raw Normal View History

2018-02-25 11:14:43 +03:00
#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