// these functions allow to completely disable all log messages
- // is logging disabled now?
+ // is logging enabled at all now?
static bool IsEnabled() { return ms_doLog; }
+ // is logging at this level enabled?
+ static bool IsLevelEnabled(wxLogLevel level)
+ { return IsEnabled() && level <= ms_logLevel; }
+
// change the flag state, return the previous one
static bool EnableLogging(bool doIt = true)
{ bool doLogOld = ms_doLog; ms_doLog = doIt; return doLogOld; }
*/
static void DontCreateOnDemand();
+ /**
+ Globally enable or disable logging.
+
+ Calling this function with @false argument disables all log messages.
+
+ @see wxLogNull, IsEnabled()
+
+ @return
+ The old state, i.e. @true if logging was previously enabled and
+ @false if it was disabled.
+ */
+ static bool EnableLogging(bool enable = true);
+
/**
Shows all the messages currently in buffer and clears it.
If the buffer is already empty, nothing happens.
/**
Returns the current log level limit.
+
+ All messages at levels strictly greater than the value returned by this
+ function are not logged at all.
+
+ @see SetLogLevel(), IsLevelEnabled()
*/
static wxLogLevel GetLogLevel();
*/
static bool IsAllowedTraceMask(const wxString& mask);
+ /**
+ Returns true if logging is enabled at all now.
+
+ @see IsLevelEnabled(), EnableLogging()
+ */
+ static bool IsEnabled();
+
+ /**
+ Returns true if logging at this level is enabled.
+
+ This function only returns @true if logging is globally enabled and if
+ this level is less than or equal to the global log level value.
+
+ @see IsEnabled(), SetLogLevel(), GetLogLevel()
+ */
+ static bool IsLevelEnabled(wxLogLevel level);
+
/**
Remove the @a mask from the list of allowed masks for
wxLogTrace().