criu/flog/include/log.h
prakritigoyal19 6f8d5435bb Add flog to CRIU
Change made through this commit:
- Include copy of flog as a seperate tree.
- Modify the makefile to add and compile flog code.

Signed-off-by: prakritigoyal19 <prakritigoyal19@gmail.com>
2022-05-12 17:55:45 -07:00

17 lines
461 B
C

#ifndef __LOG_H__
#define __LOG_H__
#include <stdio.h>
#define pr_out(fmt, ...) fprintf(stdout, fmt, ##__VA_ARGS__)
#if 1
# define pr_debug(fmt, ...) fprintf(stderr, fmt, ##__VA_ARGS__)
#else
# define pr_debug(fmt, ...)
#endif
#define pr_err(fmt, ...) fprintf(stderr, "Error (%s:%d): "fmt, __FILE__, __LINE__, ##__VA_ARGS__)
#define pr_perror(fmt, ...) fprintf(stderr, "Error (%s:%d): "fmt "%m\n", __FILE__, __LINE__, ##__VA_ARGS__)
#endif /* __LOG_H__ */