如何控制 QuickFix 打印输出

发布于 2024-11-11 16:17:46 字数 714 浏览 5 评论 0原文

我正在将 QuickFix 与 Python 绑定一起使用。
如何控制 QuickFix 的打印输出?
据我所知,没有配置参数, QuickFix 将大量日志转储到标准输出中...

这是一个示例日志(用 xxxxx 替换私人信息)

<20110603-16:56:28.172, FIX.4.3:xxxxx->xxxxx, incoming>
  (8=FIX.4.3☺9=310☺35=W☺34=5☺49=xxxxx☺52=20110603-16:57:01.872☺56=xxxxx☺57=xxxxx☺55=xxxxx☺262=cb8f5a29-25bb-4f7b-9ec7-a9a8975715eb☺460=4☺541=20110607☺268=2☺269=0☺270=2.76323☺15=xxxxx☺271=2000000☺276=A☺282=xxxxx☺299=1914b8d_BID☺290=0☺269=1☺270=2.76323☺15=xxxxx☺271=2000000☺276=A☺282=xxxxx☺299=xxxxx☺290=0☺10=xxxxx☺)

I'm using QuickFix with Python bindings.
How is it possible to control QuickFix's printouts?
As far as I can tell, there are no configuration parameters for this, and QuickFix dumps a lot of logs into the stdout...

Here's an example log (replaced private info with xxxxx)

<20110603-16:56:28.172, FIX.4.3:xxxxx->xxxxx, incoming>
  (8=FIX.4.3☺9=310☺35=W☺34=5☺49=xxxxx☺52=20110603-16:57:01.872☺56=xxxxx☺57=xxxxx☺55=xxxxx☺262=cb8f5a29-25bb-4f7b-9ec7-a9a8975715eb☺460=4☺541=20110607☺268=2☺269=0☺270=2.76323☺15=xxxxx☺271=2000000☺276=A☺282=xxxxx☺299=1914b8d_BID☺290=0☺269=1☺270=2.76323☺15=xxxxx☺271=2000000☺276=A☺282=xxxxx☺299=xxxxx☺290=0☺10=xxxxx☺)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

终弃我 2024-11-18 16:17:46

当您实例化 QF 应用程序时,通常会提供“工厂”,例如,

settings = fix.SessionSettings( fix_settings_file )
storeFactory = fix.FileStoreFactory( settings )
logFactory = fix.ScreenLogFactory( settings )
initiator = fix.SocketInitiator( self, storeFactory, settings, logFactory )
initiator.start()

如果您传递 None 而不是 logFactory (或等效地省略该参数),QF 将不会在上记录消息屏幕:

settings = fix.SessionSettings( fix_settings_file )
storeFactory = fix.FileStoreFactory( settings )    
initiator = fix.SocketInitiator( self, storeFactory, settings, logFactory = None) # or: fix.SocketInitiator( self, storeFactory, settings)

When you instantiate a QF application you typically provide 'Factories', e.g.

settings = fix.SessionSettings( fix_settings_file )
storeFactory = fix.FileStoreFactory( settings )
logFactory = fix.ScreenLogFactory( settings )
initiator = fix.SocketInitiator( self, storeFactory, settings, logFactory )
initiator.start()

If you pass None instead of the logFactory (or equivalently omit the parameter), QF will not log messages on screen:

settings = fix.SessionSettings( fix_settings_file )
storeFactory = fix.FileStoreFactory( settings )    
initiator = fix.SocketInitiator( self, storeFactory, settings, logFactory = None) # or: fix.SocketInitiator( self, storeFactory, settings)
哽咽笑 2024-11-18 16:17:46

将这些放入配置文件中应该会有所帮助。 N表示不需要。

屏幕日志事件=N
ScreenLogShowIncoming=N
ScreenLogShowOutgoing=N
ScreenLogShowHeartBeats=N

Putting these in the configuration file should help. N means not required.

ScreenLogEvents=N
ScreenLogShowIncoming=N
ScreenLogShowOutgoing=N
ScreenLogShowHeartBeats=N

淡水深流 2024-11-18 16:17:46

您是否使用这些配置参数 这些即FileStorePath ?他们通常将所有消息记录到配置文件中提到的文件和文件夹中。还有一个疑问,这些日志消息不是你的吗?

在库中,没有很多 cout 语句可以登录到 stdout,而是登录到日志文件。

而您关心的cout语句位于Log.h文件中。您可以将它们注释掉或将它们重定向到文件。

Are you using these configuration parameters and these i.e. FileStorePath ? They genearlly log all messages to the file and folder mentioned in the configuration file. And one query, are these log messages none of yours ?

In the library there aren't many cout statements to log onto stdout, but to the log files.

And the cout statements you are concerned about is in Log.h file. You can comment them out or redirect them to a file.

窝囊感情。 2024-11-18 16:17:46

也许你可以简单地重定向到 /dev/null
我不想将它们从代码中删除,因为它们对调试有很大帮助。

May be you can simply redirect to /dev/null
I will not like to remove them from code since they help a lot in debugging stuff.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文