-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue 106 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
- Loading branch information
1 parent
ab78cb5
commit 393d10d
Showing
3 changed files
with
33 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#ifndef SOCKET_VMNET_LOG_H | ||
#define SOCKET_VMNET_LOG_H | ||
#include <errno.h> | ||
extern bool debug; | ||
|
||
#define DEBUGF(fmt, ...) \ | ||
do { \ | ||
if (debug) \ | ||
fprintf(stderr, "DEBUG| " fmt "\n", __VA_ARGS__); \ | ||
} while (0) | ||
|
||
#define INFOF(fmt, ...) fprintf(stderr, "INFO | " fmt "\n", __VA_ARGS__) | ||
#define ERROR(msg) fprintf(stderr, "ERROR| " msg "\n") | ||
#define ERRORF(fmt, ...) fprintf(stderr, "ERROR| " fmt "\n", __VA_ARGS__) | ||
#define ERRORN(name) ERRORF(name ": %s", strerror(errno)) | ||
|
||
#endif /* SOCKET_VMNET_LOG_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters