Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add logmacro.h inspired by Edstrom's log macros
* should be #included after other headers and after optionally #defining VERBOSE * usage samples in z80scc.cpp and m68705.cpp 68705: add lots of logging to help trace issues
- Loading branch information
Showing
4 changed files
with
134 additions
and
47 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
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,20 @@ | ||
// license:BSD-3-Clause | ||
// copyright-holders:Vas Crabb | ||
#if defined(MAME_EMU_LOGMACRO_H) || !defined(__EMU_H__) | ||
#error This file should only be included once per compilation unit after all other headers | ||
#endif | ||
#define MAME_EMU_LOGMACRO_H | ||
|
||
#ifndef VERBOSE | ||
#define VERBOSE 0 | ||
#endif | ||
|
||
#ifndef LOG_OUTPUT_FUNC | ||
#define LOG_OUTPUT_FUNC logerror | ||
#endif | ||
|
||
#define LOG_GENERAL (1U << 0) | ||
|
||
#define LOGMASKED(mask, ...) do {if (VERBOSE & (mask)) (LOG_OUTPUT_FUNC)(__VA_ARGS__); } while (0) | ||
|
||
#define LOG(...) LOGMASKED(LOG_GENERAL, __VA_ARGS__) |