Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ TraceEvent()

static void System.Diagnostics.TraceInternal.TraceEvent ( TraceEventType eventType,
int id,
string format,
params object[] args )
inlinestatic

Definition at line 339 of file TraceInternal.cs.

340 {
341 TraceEventCache eventCache = new TraceEventCache();
342 if (UseGlobalLock)
343 {
344 lock (critSec)
345 {
346 if (args == null)
347 {
348 foreach (TraceListener listener in Listeners)
349 {
350 listener.TraceEvent(eventCache, AppName, eventType, id, format);
351 if (AutoFlush)
352 {
353 listener.Flush();
354 }
355 }
356 return;
357 }
358 foreach (TraceListener listener2 in Listeners)
359 {
360 listener2.TraceEvent(eventCache, AppName, eventType, id, format, args);
361 if (AutoFlush)
362 {
363 listener2.Flush();
364 }
365 }
366 return;
367 }
368 }
369 if (args == null)
370 {
371 foreach (TraceListener listener3 in Listeners)
372 {
373 if (!listener3.IsThreadSafe)
374 {
375 lock (listener3)
376 {
377 listener3.TraceEvent(eventCache, AppName, eventType, id, format);
378 if (AutoFlush)
379 {
380 listener3.Flush();
381 }
382 }
383 }
384 else
385 {
386 listener3.TraceEvent(eventCache, AppName, eventType, id, format);
387 if (AutoFlush)
388 {
389 listener3.Flush();
390 }
391 }
392 }
393 return;
394 }
395 foreach (TraceListener listener4 in Listeners)
396 {
397 if (!listener4.IsThreadSafe)
398 {
399 lock (listener4)
400 {
401 listener4.TraceEvent(eventCache, AppName, eventType, id, format, args);
402 if (AutoFlush)
403 {
404 listener4.Flush();
405 }
406 }
407 }
408 else
409 {
410 listener4.TraceEvent(eventCache, AppName, eventType, id, format, args);
411 if (AutoFlush)
412 {
413 listener4.Flush();
414 }
415 }
416 }
417 }
static readonly object critSec
static TraceListenerCollection Listeners

References System.Diagnostics.TraceInternal.AppName, System.Diagnostics.TraceInternal.AutoFlush, System.Diagnostics.TraceInternal.critSec, System.Diagnostics.TraceListener.Flush(), System.format, System.Diagnostics.TraceListener.IsThreadSafe, System.Diagnostics.TraceInternal.Listeners, System.Diagnostics.TraceListener.TraceEvent(), and System.Diagnostics.TraceInternal.UseGlobalLock.

Referenced by System.Diagnostics.Trace.TraceError(), System.Diagnostics.Trace.TraceError(), System.Diagnostics.Trace.TraceInformation(), System.Diagnostics.Trace.TraceInformation(), System.Diagnostics.Trace.TraceWarning(), and System.Diagnostics.Trace.TraceWarning().