+ static bool EnableLogging(bool enable = true)
+ {
+#if wxUSE_THREADS
+ if ( !wxThread::IsMain() )
+ return EnableThreadLogging(enable);
+#endif // wxUSE_THREADS
+
+ bool doLogOld = ms_doLog;
+ ms_doLog = enable;
+ return doLogOld;
+ }
+
+ // return the current global log level
+ static wxLogLevel GetLogLevel() { return ms_logLevel; }
+
+ // set global log level: messages with level > logLevel will not be logged
+ static void SetLogLevel(wxLogLevel logLevel) { ms_logLevel = logLevel; }
+
+ // set the log level for the given component
+ static void SetComponentLevel(const wxString& component, wxLogLevel level);
+
+ // return the effective log level for this component, falling back to
+ // parent component and to the default global log level if necessary
+ //
+ // NB: component argument is passed by value and not const reference in an
+ // attempt to encourage compiler to avoid an extra copy: as we modify
+ // the component internally, we'd create one anyhow and like this it
+ // can be avoided if the string is a temporary anyhow
+ static wxLogLevel GetComponentLevel(wxString component);
+
+
+ // is logging of messages from this component enabled at this level?
+ //
+ // usually always called with wxLOG_COMPONENT as second argument
+ static bool IsLevelEnabled(wxLogLevel level, wxString component)
+ {
+ return IsEnabled() && level <= GetComponentLevel(component);
+ }
+
+
+ // enable/disable messages at wxLOG_Verbose level (only relevant if the
+ // current log level is greater or equal to it)
+ //
+ // notice that verbose mode can be activated by the standard command-line
+ // '--verbose' option
+ static void SetVerbose(bool bVerbose = true) { ms_bVerbose = bVerbose; }
+
+ // check if verbose messages are enabled
+ static bool GetVerbose() { return ms_bVerbose; }
+