Make wxLogInfo() work even without wxLog::SetVerbose()

It's confusing that wxLogInfo() and wxLogVerbose() are exactly the same and
the former, and not only the latter, doesn't do anything unless SetVerbose()
had been called, even if the log level is wxLOG_Info or higher.

Fix this by checking for GetVerbose() in wxLogVerbose() only and making
wxLogInfo() check the log level only. This makes it very similar to
wxLogMessage() but this is not such a bad thing.

Also improve wxLogVerbose() documentation.
This commit is contained in:
Vadim Zeitlin
2016-03-04 15:17:35 +01:00
parent 7c32ef2ba3
commit da7388c9c8
4 changed files with 31 additions and 9 deletions

View File

@@ -1272,6 +1272,10 @@ WXDLLIMPEXP_BASE const wxChar* wxSysErrorMsg(unsigned long nErrCode = 0);
#define wxLogMessage wxDO_LOG_IF_ENABLED(Message)
#define wxVLogMessage(format, argptr) wxDO_LOGV(Message, format, argptr)
#define wxLogInfo wxDO_LOG_IF_ENABLED(Info)
#define wxVLogInfo(format, argptr) wxDO_LOGV(Info, format, argptr)
// this one is special as it only logs if we're in verbose mode
#define wxLogVerbose \
if ( !(wxLog::IsLevelEnabled(wxLOG_Info, wxLOG_COMPONENT) && \
@@ -1286,11 +1290,6 @@ WXDLLIMPEXP_BASE const wxChar* wxSysErrorMsg(unsigned long nErrCode = 0);
else \
wxDO_LOGV(Info, format, argptr)
// deprecated synonyms for wxLogVerbose() and wxVLogVerbose()
#define wxLogInfo wxLogVerbose
#define wxVLogInfo wxVLogVerbose
// another special case: the level is passed as first argument of the function
// and so is not available to the macro
//