File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
data/src/main/java/mega/privacy/android/data/gateway Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -12,19 +12,24 @@ import java.io.File
12
12
import java.io.IOException
13
13
import java.io.InputStream
14
14
import javax.inject.Inject
15
+ import javax.inject.Singleton
16
+ import kotlinx.coroutines.sync.Mutex
17
+ import kotlinx.coroutines.sync.withLock
15
18
16
19
17
20
/* *
18
21
* Logback log configuration gateway implementation of [LogConfigurationGateway]
19
22
*
20
23
* @property context
21
24
*/
25
+ @Singleton
22
26
class LogbackLogConfigurationGateway @Inject constructor(
23
27
@ApplicationContext private val context : Context ,
24
- @LogFileDirectory private val logFileDirectory : Lazy <File >
28
+ @LogFileDirectory private val logFileDirectory : Lazy <File >,
25
29
) : LogConfigurationGateway {
30
+ private val mutex = Mutex ()
26
31
27
- override suspend fun resetLoggingConfiguration () {
32
+ override suspend fun resetLoggingConfiguration () = mutex.withLock {
28
33
val loggingContext = LoggerFactory .getILoggerFactory() as LoggerContext
29
34
val loggers = loggingContext.copyOfListenerList
30
35
loggingContext.reset()
You can’t perform that action at this time.
0 commit comments