diff --git a/interface/wx/log.h b/interface/wx/log.h index ed9469a6e3..116bb19cff 100644 --- a/interface/wx/log.h +++ b/interface/wx/log.h @@ -384,6 +384,9 @@ public: All messages at levels strictly greater than the value returned by this function are not logged at all. + Note that this function is *not* thread-safe and should only be used + from the main thread. + @see SetLogLevel(), IsLevelEnabled() */ static wxLogLevel GetLogLevel(); @@ -395,6 +398,9 @@ public: @a level is less than or equal to the maximal log level enabled for the given @a component. + Note that this function is *not* thread-safe and should only be used + from the main thread. + @see IsEnabled(), SetLogLevel(), GetLogLevel(), SetComponentLevel() @since 2.9.1 @@ -427,6 +433,10 @@ public: Specifies that log messages with level greater (numerically) than @a logLevel should be ignored and not sent to the active log target. + Note that this function is *not* thread-safe and can only be called + from the main thread. To temporarily disable logging from the other + threads, use wxLogNull, which is safe to use from them. + @see SetComponentLevel() */ static void SetLogLevel(wxLogLevel logLevel); @@ -446,6 +456,9 @@ public: Calling this function with @false argument disables all log messages for the current thread. + This function is thread-safe and can be called by multiple threads + concurrently. + @see wxLogNull, IsEnabled() @return @@ -457,6 +470,9 @@ public: /** Returns true if logging is enabled at all now. + This function is thread-safe and can be called by multiple threads + concurrently. + @see IsLevelEnabled(), EnableLogging() */ static bool IsEnabled(); @@ -937,6 +953,8 @@ public: } @endcode + This class is thread-safe and can be used from both the main and the + backgrounds threads. @library{wxbase} @category{logging} diff --git a/src/common/zipstrm.cpp b/src/common/zipstrm.cpp index b6118daa72..28c708576c 100644 --- a/src/common/zipstrm.cpp +++ b/src/common/zipstrm.cpp @@ -146,14 +146,9 @@ static inline wxUint16 CrackUint16(const char *m) static wxFileOffset QuietSeek(wxInputStream& stream, wxFileOffset pos) { #if wxUSE_LOG - wxLogLevel level = wxLog::GetLogLevel(); - wxLog::SetLogLevel(wxLOG_Debug - 1); - wxFileOffset result = stream.SeekI(pos); - wxLog::SetLogLevel(level); - return result; -#else - return stream.SeekI(pos); + wxLogNull noLog; #endif + return stream.SeekI(pos); }