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

◆ WriteEventVarargs()

unsafe void System.Diagnostics.Tracing.EventSource.WriteEventVarargs ( int eventId,
Guid * childActivityID,
object[] args )
inlineprivateinherited

Definition at line 1380 of file EventSource.cs.

1381 {
1382 if (!IsEnabled())
1383 {
1384 return;
1385 }
1386 try
1387 {
1388 ref EventMetadata reference = ref m_eventData[eventId];
1389 if (childActivityID != null && !reference.HasRelatedActivityID)
1390 {
1391 throw new ArgumentException(SR.EventSource_NoRelatedActivityId);
1392 }
1394 Guid* ptr = null;
1397 EventOpcode opcode = (EventOpcode)reference.Descriptor.Opcode;
1398 EventActivityOptions activityOptions = reference.ActivityOptions;
1399 if (childActivityID == null && (activityOptions & EventActivityOptions.Disable) == 0)
1400 {
1401 switch (opcode)
1402 {
1403 case EventOpcode.Start:
1405 break;
1406 case EventOpcode.Stop:
1408 break;
1409 }
1410 if (activityId != Guid.Empty)
1411 {
1412 ptr = &activityId;
1413 }
1415 {
1417 }
1418 }
1419 if (reference.EnabledForETW || reference.EnabledForEventPipe)
1420 {
1422 {
1423 if (!m_etwProvider.WriteEvent(ref reference.Descriptor, reference.EventHandle, ptr, childActivityID, args))
1424 {
1426 }
1427 if (!m_eventPipeProvider.WriteEvent(ref reference.Descriptor, reference.EventHandle, ptr, childActivityID, args))
1428 {
1430 }
1431 }
1432 else
1433 {
1434 EventSourceOptions eventSourceOptions = default(EventSourceOptions);
1435 eventSourceOptions.Keywords = (EventKeywords)reference.Descriptor.Keywords;
1436 eventSourceOptions.Level = (EventLevel)reference.Descriptor.Level;
1437 eventSourceOptions.Opcode = (EventOpcode)reference.Descriptor.Opcode;
1438 EventSourceOptions options = eventSourceOptions;
1439 WriteMultiMerge(reference.Name, ref options, reference.TraceLoggingEventTypes, ptr, childActivityID, args);
1440 }
1441 }
1442 if (m_Dispatchers != null && reference.EnabledForAnyListener)
1443 {
1444 if (!LocalAppContextSwitches.PreserveEventListnerObjectIdentity)
1445 {
1447 }
1448 EventWrittenEventArgs eventCallbackArgs = new EventWrittenEventArgs(this, eventId, ptr, childActivityID)
1449 {
1450 Payload = new ReadOnlyCollection<object>(args)
1451 };
1453 }
1454 }
1455 catch (Exception ex)
1456 {
1457 if (ex is EventSourceException)
1458 {
1459 throw;
1460 }
1462 }
1463 }
void OnStart(string providerName, string activityName, int task, ref Guid activityId, ref Guid relatedActivityId, EventActivityOptions options, bool useTplSource=true)
void OnStop(string providerName, string activityName, int task, ref Guid activityId, bool useTplSource=true)
void DispatchToAllListeners(EventWrittenEventArgs eventCallbackArgs)
void LogEventArgsMismatches(int eventId, object[] args)
volatile OverrideEventProvider m_eventPipeProvider
volatile EventMetadata[] m_eventData
volatile OverrideEventProvider m_etwProvider
volatile EventDispatcher m_Dispatchers
object[] SerializeEventArgs(int eventId, object[] args)
void ThrowEventSourceException(string eventName, Exception innerEx=null)
unsafe void WriteMultiMerge(string eventName, ref EventSourceOptions options, TraceLoggingEventTypes eventTypes, Guid *activityID, Guid *childActivityID, params object[] values)
static readonly Guid Empty
Definition Guid.cs:86

References System.Diagnostics.Tracing.EventSource.DispatchToAllListeners(), System.Guid.Empty, System.SR.EventSource_NoRelatedActivityId, System.Diagnostics.Tracing.EventSource.IsEnabled(), System.Diagnostics.Tracing.EventSource.LogEventArgsMismatches(), System.Diagnostics.Tracing.EventSource.m_activityTracker, System.Diagnostics.Tracing.EventSource.m_Dispatchers, System.Diagnostics.Tracing.EventSource.m_etwProvider, System.Diagnostics.Tracing.EventSource.m_eventData, System.Diagnostics.Tracing.EventSource.m_eventPipeProvider, System.Diagnostics.Tracing.EventSource.m_name, System.Diagnostics.Tracing.EventSource.Name, System.Diagnostics.Tracing.ActivityTracker.OnStart(), System.Diagnostics.Tracing.ActivityTracker.OnStop(), System.options, System.LocalAppContextSwitches.PreserveEventListnerObjectIdentity, System.Diagnostics.Tracing.EventSource.SelfDescribingEvents, System.Diagnostics.Tracing.EventSource.SerializeEventArgs(), System.Diagnostics.Tracing.EventSource.ThrowEventSourceException(), and System.Diagnostics.Tracing.EventSource.WriteMultiMerge().

Referenced by System.Diagnostics.Tracing.EventSource.WriteEvent(), and System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityId().