From 258978dc379ea20fbb0e29438bb68010e8a58737 Mon Sep 17 00:00:00 2001 From: bubibubi Date: Sat, 16 Sep 2017 11:34:38 +0200 Subject: [PATCH] Removed debug output --- src/System.Data.Jet/JetCommand.cs | 4 ++-- src/System.Data.Jet/LogHelper.cs | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/System.Data.Jet/JetCommand.cs b/src/System.Data.Jet/JetCommand.cs index d6616db..f17b467 100644 --- a/src/System.Data.Jet/JetCommand.cs +++ b/src/System.Data.Jet/JetCommand.cs @@ -485,7 +485,7 @@ namespace System.Data.Jet command.CommandText = "Select @@identity"; object identity = command.ExecuteScalar(); int iIdentity = Convert.ToInt32(identity); - Console.WriteLine("@@identity = {0}", iIdentity); + LogHelper.ShowInfo("@@identity = {0}", iIdentity); return Regex.Replace(commandText, "@@identity", iIdentity.ToString(System.Globalization.CultureInfo.InvariantCulture), RegexOptions.IgnoreCase); } return commandText; @@ -502,7 +502,7 @@ namespace System.Data.Jet if (commandText.ToLower().Contains("@@guid")) { - Console.WriteLine("@@guid = {{{0}}}", _lastGuid); + LogHelper.ShowInfo("@@guid = {{{0}}}", _lastGuid); commandText = Regex.Replace(commandText, "@@guid", string.Format("{{{0}}}", _lastGuid), RegexOptions.IgnoreCase); } return commandText; diff --git a/src/System.Data.Jet/LogHelper.cs b/src/System.Data.Jet/LogHelper.cs index f5d3e73..c5252ad 100644 --- a/src/System.Data.Jet/LogHelper.cs +++ b/src/System.Data.Jet/LogHelper.cs @@ -5,6 +5,24 @@ using System.Data.Jet; static internal class LogHelper { + + internal static void ShowInfo(string info) + { + if (!JetConfiguration.ShowSqlStatements) + return; + + Console.WriteLine(info); + } + + internal static void ShowInfo(string format, params object[] args) + { + if (!JetConfiguration.ShowSqlStatements) + return; + + Console.WriteLine(format, args); + } + + internal static void ShowCommandHeader(string caller) { if (!JetConfiguration.ShowSqlStatements) @@ -13,6 +31,7 @@ static internal class LogHelper Console.WriteLine("{0}==========", caller); } + internal static void ShowCommandText(string caller, DbCommand command) { if (!JetConfiguration.ShowSqlStatements)