-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to disable logging information
- Loading branch information
Showing
5 changed files
with
52 additions
and
21 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
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,23 @@ | ||
#ifndef CRACON_LOG_HPP | ||
#define CRACON_LOG_HPP | ||
|
||
#include <cstdio> | ||
|
||
#ifdef CRACON_ENABLE_LOG | ||
#define CRACON_LOG_IMPL_DEBUG(...) fprintf(stdout, __VA_ARGS__) | ||
#define CRACON_LOG_IMPL_INFO(...) fprintf(stdout, __VA_ARGS__) | ||
#define CRACON_LOG_IMPL_WARNING(...) fprintf(stderr, __VA_ARGS__) | ||
#define CRACON_LOG_IMPL_ERROR(...) fprintf(stderr, __VA_ARGS__) | ||
#else | ||
#define CRACON_LOG_IMPL_DEBUG(...) {} | ||
#define CRACON_LOG_IMPL_INFO(...) {} | ||
#define CRACON_LOG_IMPL_WARNING(...) {} | ||
#define CRACON_LOG_IMPL_ERROR(...) {} | ||
#endif | ||
|
||
#define CRACON_LOG_DEBUG(...) CRACON_LOG_IMPL_DEBUG("[cracon] [DEBUG] " __VA_ARGS__) | ||
#define CRACON_LOG_INFO(...) CRACON_LOG_IMPL_INFO("[cracon] [INFO] " __VA_ARGS__) | ||
#define CRACON_LOG_WARNING(...) CRACON_LOG_IMPL_WARNING("[cracon] [WARN] " __VA_ARGS__) | ||
#define CRACON_LOG_ERROR(...) CRACON_LOG_IMPL_ERROR("[cracon] [ERROR] " __VA_ARGS__) | ||
|
||
#endif |
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