Hi,

I've got a small suggestion for the .Net Provider.

Wouldn't it be better to have the trace output disabled by default so you have 
to enable it to get in within Visual studio, instead of having it enabled by 
default and forcing everybody to disable it explicitly in order not to have it 
within visual studio?

I think that if you replace the line

_instance = new TraceSource(Name, SourceLevels.All);

by 

_instance = new TraceSource(Name, SourceLevels.None);

That does the trick. You don't get all that trace within visual studio, and you 
can still get it if you enable it in the app.config file in case you need it to 
debug something.

That's what I've done at my place, because I use the Firebird .Net provider in 
a single dll which is then used in many applications, and otherwise I should 
have had to disable the trace explicitly in the app.config file of each of 
these apps in order not to get it.

But beside that small detail, that's a really cool feature. Thanks a lot for it.

Marc

-----Original Message-----
From: Baldur Fürchau (JIRA) [mailto:trac...@firebirdsql.org] 
Sent: lundi 14 mai 2012 22:18
To: firebird-net-provider@lists.sourceforge.net
Subject: [Firebird-net-provider] [FB-Tracker] Created: (DNET-431) Configurable 
Traceoutput

Configurable Traceoutput
------------------------

                 Key: DNET-431
                 URL: http://tracker.firebirdsql.org/browse/DNET-431
             Project: .NET Data provider
          Issue Type: New Feature
          Components: ADO.NET Provider
    Affects Versions: 2.7.5
         Environment: Visual Studio 2010
            Reporter: Baldur Fürchau
            Assignee: Jiri Cincura


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 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.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and threat 
landscape has changed and how IT managers can respond. Discussions will include 
endpoint security, mobile security and the latest in malware threats. 
http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider



------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider

Reply via email to