You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a thread and logs anything withing the run method using XLog.d("you message here") and the configs have enableThreadInfo(), the interrupted flag will be reset right after the first logged message.
The test code:
class LogTestThread : Thread() {
override fun run() {
XLog.d("before interruption")
interrupt()
var isInterruptedBeforeLog = isInterrupted()
XLog.d("after interruption")
var isInterruptedAfterLog = isInterrupted()
}
}
fun main(){
val thread = LogTestThread()
thread.start()
}
In the code above isInterruptedBeforeLog should be true
and isInterruptedAfterLog should be true
but isInterruptedAfterLog will be false
But, if you don't enable LogConfiguration.Builder().enableThreadInfo() the code above works as expected.
The text was updated successfully, but these errors were encountered:
Well, actually, sometimes, the issue reproduces even if the enableThreadInfo() is not enabled. The library itself messes up with threads. If I replace the log function call with the default logger, the issue goes away, but if I use XLog it reproduces again and again.
If you have a thread and logs anything withing the run method using XLog.d("you message here") and the configs have enableThreadInfo(), the interrupted flag will be reset right after the first logged message.
The test code:
In the code above
isInterruptedBeforeLog
should be trueand
isInterruptedAfterLog
should be truebut
isInterruptedAfterLog
will be falseBut, if you don't enable
LogConfiguration.Builder().enableThreadInfo()
the code above works as expected.The text was updated successfully, but these errors were encountered: