summaryrefslogtreecommitdiffstats
path: root/src/lisiblestd/log.h
blob: c280034d8dc815eebc3f107bc8a4a55a06bddf56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
Go back to lisible.xyz