/// <summary>
        /// Adds a trace to the log.
        /// </summary>
        /// <param name="type">The type of the trace.</param>
        /// <param name="tag1">The first tag associated with the trace.</param>
        /// <param name="data1">The data associated with the first tag.</param>
        /// <param name="tag2">The second tag associated with the trace.</param>
        /// <param name="data2">The data associated with the second tag.</param>
        /// <param name="tag3">The third tag associated with the trace.</param>
        /// <param name="data3">The data associated with the third tag.</param>
        public void addTrace(NSFString type, NSFString tag1, NSFString data1, NSFString tag2, NSFString data2, NSFString tag3, NSFString data3)
        {
            // If logging is not enabled then return without action
            if (!enabled)
            {
                return;
            }

            // Lock to prevent events from being added to the queue with timestamps out of order
            lock (traceLogMutex)
            {
                try
                {
                    // Create the new trace element
                    NSFXMLElement trace = new NSFXMLElement(TraceTag);

                    // Add the time
                    trace.addChildElementBack(new NSFXMLElement(TimeTag, NSFTimerThread.PrimaryTimerThread.CurrentTime.ToString()));

                    // Add a trace for the type
                    NSFXMLElement typeTrace = new NSFXMLElement(type);
                    trace.addChildElementBack(typeTrace);

                    // Add the new data under the type element;
                    typeTrace.addChildElementBack(new NSFXMLElement(tag1, data1));

                    if (tag2 != null)
                    {
                        typeTrace.addChildElementBack(new NSFXMLElement(tag2, data2));
                    }
                    if (tag3 != null)
                    {
                        typeTrace.addChildElementBack(new NSFXMLElement(tag3, data3));
                    }

                    eventHandler.queueEvent(traceAddEvent.copy(trace));
                }
                catch
                {
                    // If unable to add a trace, just do nothing, because calling the exception handler may result in an infinite loop
                }
            }
        }
        /// <summary>
        /// Adds a trace to the log.
        /// </summary>
        /// <param name="type">The type of the trace.</param>
        /// <param name="tag1">The first tag associated with the trace.</param>
        /// <param name="data1">The data associated with the first tag.</param>
        /// <param name="tag2">The second tag associated with the trace.</param>
        /// <param name="data2">The data associated with the second tag.</param>
        /// <param name="tag3">The third tag associated with the trace.</param>
        /// <param name="data3">The data associated with the third tag.</param>
        public void addTrace(NSFString type, NSFString tag1, NSFString data1, NSFString tag2, NSFString data2, NSFString tag3, NSFString data3)
        {
            // If logging is not enabled then return without action
            if (!enabled)
            {
                return;
            }

            // Lock to prevent events from being added to the queue with timestamps out of order
            lock (traceLogMutex)
            {
                try
                {
                    // Create the new trace element
                    NSFXMLElement trace = new NSFXMLElement(TraceTag);

                    // Add the time
                    trace.addChildElementBack(new NSFXMLElement(TimeTag, NSFTimerThread.PrimaryTimerThread.CurrentTime.ToString()));

                    // Add a trace for the type
                    NSFXMLElement typeTrace = new NSFXMLElement(type);
                    trace.addChildElementBack(typeTrace);

                    // Add the new data under the type element;
                    typeTrace.addChildElementBack(new NSFXMLElement(tag1, data1));

                    if (tag2 != null) typeTrace.addChildElementBack(new NSFXMLElement(tag2, data2));
                    if (tag3 != null) typeTrace.addChildElementBack(new NSFXMLElement(tag3, data3));

                    eventHandler.queueEvent(traceAddEvent.copy(trace));
                }
                catch
                {
                    // If unable to add a trace, just do nothing, because calling the exception handler may result in an infinite loop
                }
            }
        }