简体   繁体   English

防止 Firebird 在 Visual Studio 调试输出窗口中打印查询

[英]Prevent Firebird from printing queries in Visual Studio debug output window

We have newly adopted Firebird in our project, using it via Entity Framework.我们在我们的项目中新采用了 Firebird,通过实体框架使用它。 I now noticed that Firebird prints every query to Visual Studio's debug output window.我现在注意到 Firebird 将每个查询打印到 Visual Studio 的调试输出窗口。 Here's a simplified example:这是一个简化的示例:

FirebirdSql.Data.FirebirdClient Information: 0 : Command:
SELECT 
"B"."FOO" AS "FOO" 
FROM "BAR" AS "B"
WHERE [...]
Parameters:
Name:p__linq__0 Type:TimeStamp  Used Value:19.03.2020 07:57:59
Name:p__linq__1 Type:Guid   Used Value:00000000-0000-0000-0000-000000000000

With the old DBMS we didn't have such output, so I don't think that some generic Entity Framework feature is at work here.使用旧的 DBMS 我们没有这样的输出,所以我不认为一些通用的实体框架功能在这里工作。 I am aware of DbContext.Database.Log , but I doublechecked that we don't use this in our code base.我知道DbContext.Database.Log ,但我DbContext.Database.Log过我们没有在我们的代码库中使用它。

I verified that it's not our logging framework (log4net) that redirects something to the VS debug output.我确认不是我们的日志框架 (log4net) 将某些内容重定向到 VS 调试输出。 Our app.config also does not contain anything that looks suspicious.我们的 app.config 也不包含任何看起来可疑的东西。 Last but not least, an internet search didn't yield anything useful.最后但并非最不重要的一点是,互联网搜索没有产生任何有用的信息。

So I am really at a loss here.所以我真的很茫然。 Do you know where this output comes from, and how I can disable it?你知道这个输出来自哪里,我如何禁用它?

We use Visual Studio 2019 and Firebird 3.我们使用 Visual Studio 2019 和 Firebird 3。

Open your app.config and add this code:打开您的app.config并添加以下代码:

<system.diagnostics>
    <sources>
      <source name="FirebirdSql.Data.FirebirdClient">
        <listeners>
          <clear />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

Now no diagnostics listener is configured and you get no output.现在没有配置诊断侦听器,也没有输出。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有一种方法可以防止Visual Studio将线程退出的语句打印到“输出窗口”中? - Is there a way to prevent Visual Studio from printing Thread exited statements into the Output Window? Visual Studio中输出窗口没有调试选项 - No debug option for output window in Visual Studio 如何在 Visual Studio 上过滤调试 output window? - How to filter debug output window on visual studio? Visual Studio调试窗口条输出 - Visual Studio debug window strips output Visual Studio - 如何将调试信息输出到调试窗口? - Visual Studio - How can I output debug information to debug window? Visual Studio 2013中的“输出”窗口不显示“调试”或“跟踪”的输出 - Output window in Visual Studio 2013 does not show output from Debug or Trace Visual Studio - 从调试输出中过滤异常 - Visual Studio - Filter exceptions from debug output 能否以编程方式清除 Visual Studio(调试)输出窗口? - Can the Visual Studio (debug) Output window be programmatically cleared? 如何在调试输出窗口中删除不需要的消息 - Visual Studio 上的 Xamarin - How to remove unwanted messages in debug output window - Xamarin on visual studio 将控制台重定向到 app.config 中的 Visual Studio 调试输出窗口 - Redirect console to Visual Studio debug output window in app.config
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM