Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable Traceoutput [DNET431] #428

Closed
firebird-automations opened this issue May 14, 2012 · 2 comments
Closed

Configurable Traceoutput [DNET431] #428

firebird-automations opened this issue May 14, 2012 · 2 comments

Comments

@firebird-automations
Copy link

Submitted by: Baldur Fürchau (bfuerchau)

In the new versions you using many trace output to the debug window of Visual Studion 2010.
This slows down dramatically the entire application.
Please make this feature configurable, so i can turn off or turn on this trace.

I have downloaded the actual source 2.7.5 and made a little modification:

public static class TraceHelper
\{
	public const string Name = "FirebirdSql\.Data\.FirebirdClient";
	public const string ConditionalSymbol = "TRACE";


	static TraceSource \_instance;
    static bool \_Activated = true;

    public static bool TraceActivated
    \{
        get \{ return \_Activated;\}
        set
        \{
        	\_Activated = value;
        \}
    \}

	static TraceHelper\(\)
	\{
		\_instance = new TraceSource\(Name, SourceLevels\.All\);
	\}

	public static void Trace\(TraceEventType eventType, string format, params object\[\] args\)
	\{
        if \(\_Activated == true\) \{ 
		    \_instance\.TraceEvent\(TraceEventType\.Information, default\(int\), format, args\);
		    \_instance\.Flush\(\);
        \}
	\}
\}

No i can in my application simply set

    FirebirdSql\.Data\.Common\.TraceHelper\.TraceActivated = False

On a simple ExecuteReader the execution time is reduced from 0.87 seconds to 0.12 seconds!
The reason is, that http://ADO.NET executes for each column a new SQL, that will also be traced to the output.

It would by nice, to have this feature automaticly.

@firebird-automations
Copy link
Author

Commented by: @cincuranet

You can turn it off in app.config/web.config (http://msdn.microsoft.com/en-us/library/ms228993.aspx).

@firebird-automations
Copy link
Author

Modified by: @cincuranet

status: Open [ 1 ] => Closed [ 6 ]

resolution: Won't Fix [ 2 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants