diff options
author | Matthias Huck <huck@i6.informatik.rwth-aachen.de> | 2014-12-04 22:13:42 +0300 |
---|---|---|
committer | Matthias Huck <huck@i6.informatik.rwth-aachen.de> | 2014-12-04 22:13:42 +0300 |
commit | 0f9e8aec91e51cfb93c6f5345f48f93a5a6d8e09 (patch) | |
tree | 752294059c92ba9fbcf84843d863bf4fe2b807fc /moses/Util.h | |
parent | 38102061d26c022e0deb5f082422a344748dc5fd (diff) |
verbosity macros
Diffstat (limited to 'moses/Util.h')
-rw-r--r-- | moses/Util.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/moses/Util.h b/moses/Util.h index ca34fcfb0..61db1bf27 100644 --- a/moses/Util.h +++ b/moses/Util.h @@ -57,13 +57,13 @@ namespace Moses /** verbose macros * */ -#define VERBOSE(level,str) { if (StaticData::Instance().GetVerboseLevel() >= level) { TRACE_ERR(str); } } +#define VERBOSE(level,str) { IFVERBOSE(level) { TRACE_ERR(str); } } #define IFVERBOSE(level) if (StaticData::Instance().GetVerboseLevel() >= level) -#define XVERBOSE(level,str) { if (StaticData::Instance().GetVerboseLevel() >= level) { TRACE_ERR("[" << __FILE__ << ":" << __LINE__ << "] "); TRACE_ERR(str); } } +#define XVERBOSE(level,str) VERBOSE(level, "[" << HERE << "] " << str) #define HERE __FILE__ << ":" << __LINE__ -#define FEATUREVERBOSE(level,str) { if (m_verbosity >= level) { TRACE_ERR("[" << GetScoreProducerDescription() << "] "); FEATUREVERBOSE2(level,str); } } -#define FEATUREVERBOSE2(level,str) { if (m_verbosity >= level) { TRACE_ERR(str); } } -#define IFFEATUREVERBOSE(level) if (m_verbosity >= level) +#define FEATUREVERBOSE(level,str) FEATUREVERBOSE2(level, "[" << GetScoreProducerDescription() << "] " << str) +#define FEATUREVERBOSE2(level,str) { IFFEATUREVERBOSE(level) { TRACE_ERR(str); } } +#define IFFEATUREVERBOSE(level) if ((m_verbosity == std::numeric_limits<std::size_t>::max() && StaticData::Instance().GetVerboseLevel() >= level) || (m_verbosity != std::numeric_limits<std::size_t>::max() && m_verbosity >= level)) #if __GNUC__ == 4 && __GNUC_MINOR__ == 8 && (__GNUC_PATCHLEVEL__ == 1 || __GNUC_PATCHLEVEL__ == 2) |