[Mono-bugs] [Bug 499442] New: Double printing using ConsoleTraceListener

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Apr 29 14:15:17 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=499442


           Summary: Double printing using ConsoleTraceListener
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.4.x
          Platform: Other
        OS/Version: RHEL 4
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: dwayne at zeroc.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development


Description of Problem:

The ConsoleTraceListener is double printing when used in conjunction with
TraceSwitch. Below are two simple examples that cause this to happen. 

In the first case the double printing happens when I add the "Info" level to
the TraceSwitch constructor options. 

In the second case the double printing occurs if I access the Warning member of
the switch before I do a write.If I do a write before I access Warning than it
does not double print.


Steps to reproduce the problem:

1. Compile and run the following program

#define TRACE

public class Test
{
    public static void Main(string[] args)
    {
        System.Diagnostics.TraceSwitch myswitch = new
System.Diagnostics.TraceSwitch("myswitch", "Test Switch", "Info");
        System.Diagnostics.Trace.WriteLine("Here is a message");
    }
}


2. Compile and run the following program

#define TRACE

public class Test
{
    public static void Main(string[] args)
    {
        System.Diagnostics.TraceSwitch myswitch = new
System.Diagnostics.TraceSwitch("myswitch", "Test Switch");
        bool warning = myswitch.TraceWarning;
        System.Diagnostics.Trace.WriteLine("Here is a message");
    }
}


Actual Results:

The message is printed twice.


Expected Results:

The message should only appear once.


How often does this happen? 

Always


Additional Information:

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list