@@ -1314,7 +1314,10 @@ internal void Deactivate(bool connectionIsDoomed)
13141314 // Called when the connection that owns us is deactivated.
13151315
13161316 SqlClientEventSource.Log.AdvanceTrace("<sc.TdsParser.Deactivate|ADV> {0}# deactivating", ObjectID);
1317- SqlClientEventSource.Log.StateDumpEvent("<sc.TdsParser.Deactivate|STATE> {0}#, {1}", ObjectID, TraceString());
1317+ if (SqlClientEventSource.Log.IsStateDumpEnabled())
1318+ {
1319+ SqlClientEventSource.Log.StateDumpEvent("<sc.TdsParser.Deactivate|STATE> {0}#, {1}", ObjectID, TraceString());
1320+ }
13181321
13191322 if (MARSOn)
13201323 {
@@ -13502,13 +13505,13 @@ internal ulong PlpBytesTotalLength(TdsParserStateObject stateObj)
1350213505 ;
1350313506 internal string TraceString()
1350413507 {
13505- return String .Format(/*IFormatProvider*/ null,
13508+ return string .Format(/*IFormatProvider*/ null,
1350613509 StateTraceFormatString,
13507- null == _physicalStateObj,
13508- null == _pMarsPhysicalConObj,
13510+ null == _physicalStateObj ? bool.TrueString : bool.FalseString ,
13511+ null == _pMarsPhysicalConObj ? bool.TrueString : bool.FalseString ,
1350913512 _state,
1351013513 _server,
13511- _fResetConnection,
13514+ _fResetConnection ? bool.TrueString : bool.FalseString ,
1351213515 null == _defaultCollation ? "(null)" : _defaultCollation.TraceString(),
1351313516 _defaultCodePage,
1351413517 _defaultLCID,
@@ -13520,19 +13523,19 @@ internal string TraceString()
1352013523 _retainedTransactionId,
1352113524 _nonTransactedOpenResultCount,
1352213525 null == _connHandler ? "(null)" : _connHandler.ObjectID.ToString((IFormatProvider)null),
13523- _fMARS,
13526+ _fMARS ? bool.TrueString : bool.FalseString ,
1352413527 null == _sessionPool ? "(null)" : _sessionPool.TraceString(),
13525- _isShiloh,
13526- _isShilohSP1,
13527- _isYukon,
13528+ _isShiloh ? bool.TrueString : bool.FalseString ,
13529+ _isShilohSP1 ? bool.TrueString : bool.FalseString ,
13530+ _isYukon ? bool.TrueString : bool.FalseString ,
1352813531 null == _sniSpnBuffer ? "(null)" : _sniSpnBuffer.Length.ToString((IFormatProvider)null),
1352913532 _physicalStateObj != null ? "(null)" : _physicalStateObj.ErrorCount.ToString((IFormatProvider)null),
1353013533 _physicalStateObj != null ? "(null)" : _physicalStateObj.WarningCount.ToString((IFormatProvider)null),
1353113534 _physicalStateObj != null ? "(null)" : _physicalStateObj.PreAttentionErrorCount.ToString((IFormatProvider)null),
1353213535 _physicalStateObj != null ? "(null)" : _physicalStateObj.PreAttentionWarningCount.ToString((IFormatProvider)null),
13533- null == _statistics,
13534- _statisticsIsInTransaction,
13535- _fPreserveTransaction,
13536+ null == _statistics ? bool.TrueString : bool.FalseString ,
13537+ _statisticsIsInTransaction ? bool.TrueString : bool.FalseString ,
13538+ _fPreserveTransaction ? bool.TrueString : bool.FalseString ,
1353613539 null == _connHandler ? "(null)" : _connHandler.ConnectionOptions.MultiSubnetFailover.ToString((IFormatProvider)null),
1353713540 null == _connHandler ? "(null)" : _connHandler.ConnectionOptions.TransparentNetworkIPResolution.ToString((IFormatProvider)null));
1353813541 }
0 commit comments