@@ -16,12 +16,9 @@ public class LogQueue
16
16
17
17
private readonly Queue < string > logInfoQueue = new ( ) ;
18
18
19
- public async Task Commit ( string info )
19
+ public void Commit ( string info )
20
20
{
21
- await Task . Run ( ( ) =>
22
- {
23
- lock ( queueLock ) logInfoQueue . Enqueue ( info ) ;
24
- } ) ;
21
+ lock ( queueLock ) logInfoQueue . Enqueue ( info ) ;
25
22
}
26
23
27
24
public static bool IsClosed { get ; private set ; } = false ;
@@ -79,7 +76,6 @@ private LogQueue()
79
76
) . Start ( ) ;
80
77
} )
81
78
{ IsBackground = true } . Start ( ) ;
82
- var t = new Thread ( ( ) => { } ) ;
83
79
}
84
80
}
85
81
@@ -97,7 +93,7 @@ public void ConsoleLog(string msg, bool Duplicate = true)
97
93
if ( ! Background )
98
94
Console . WriteLine ( info ) ;
99
95
if ( Duplicate )
100
- _ = LogQueue . Global . Commit ( info ) ;
96
+ LogQueue . Global . Commit ( info ) ;
101
97
}
102
98
}
103
99
public void ConsoleLogDebug ( string msg , bool Duplicate = true )
@@ -109,22 +105,22 @@ public void ConsoleLogDebug(string msg, bool Duplicate = true)
109
105
if ( ! Background )
110
106
Console . WriteLine ( info ) ;
111
107
if ( Duplicate )
112
- _ = LogQueue . Global . Commit ( info ) ;
108
+ LogQueue . Global . Commit ( info ) ;
113
109
}
114
110
#endif
115
111
}
116
112
public static void RawConsoleLog ( string msg , bool Duplicate = true )
117
113
{
118
114
Console . WriteLine ( msg ) ;
119
115
if ( Duplicate )
120
- _ = LogQueue . Global . Commit ( msg ) ;
116
+ LogQueue . Global . Commit ( msg ) ;
121
117
}
122
118
public static void RawConsoleLogDebug ( string msg , bool Duplicate = true )
123
119
{
124
120
#if DEBUG
125
121
Console . WriteLine ( msg ) ;
126
122
if ( Duplicate )
127
- _ = LogQueue . Global . Commit ( msg ) ;
123
+ LogQueue . Global . Commit ( msg ) ;
128
124
#endif
129
125
}
130
126
0 commit comments