diff options
| author | Clement Sibille <clements+git@lisible.xyz> | 2024-05-09 08:58:14 +0900 |
|---|---|---|
| committer | Clement Sibille <clements+git@lisible.xyz> | 2024-05-09 08:58:14 +0900 |
| commit | 5a26e1f481fe85f08093a414e27c1056b85c6715 (patch) | |
| tree | 20a2384554cfcb437a4b604e02b4a9978507cafc /src/lisiblestd/log.h | |
Initial commit
Diffstat (limited to 'src/lisiblestd/log.h')
| -rw-r--r-- | src/lisiblestd/log.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lisiblestd/log.h b/src/lisiblestd/log.h new file mode 100644 index 0000000..c280034 --- /dev/null +++ b/src/lisiblestd/log.h @@ -0,0 +1,18 @@ +#ifndef LSTD_LOG_H +#define LSTD_LOG_H + +#include <stdio.h> + +#define LOG_PREFIX "[%s:%d] " + +#define LOG0(msg) \ + do { \ + fprintf(stderr, LOG_PREFIX "%s\n", __FILE__, __LINE__, msg); \ + } while (0) + +#define LOG(fmt, ...) \ + do { \ + fprintf(stderr, LOG_PREFIX fmt "\n", __FILE__, __LINE__, __VA_ARGS__); \ + } while (0) + +#endif // LSTD_LOG_H |
