我正在使用QuickFix和Python绑定
如何控制QuickFix的打印输出?
据我所知,这没有configuration parameters,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☺)
答案 0 :(得分:7)
当您实例化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)
答案 1 :(得分:6)
将这些放在配置文件中应该有所帮助。 N表示不需要。
ScreenLogEvents = N ScreenLogShowIncoming = N ScreenLogShowOutgoing = N ScreenLogShowHeartBeats = N
答案 2 :(得分:1)
Are you using these configuration parameters 和 these i.e. FileStorePath ?他们通常会将所有消息记录到配置文件中提到的文件和文件夹中。还有一个问题,这些日志消息都不是你的吗?
在库中登录stdout并没有很多cout语句,而是登录日志文件。
您关注的cout语句位于Log.h 文件中。您可以将它们注释掉或将它们重定向到文件。
答案 3 :(得分:0)
可能只需重定向到/ dev / null即可 我不想从代码中删除它们,因为它们在调试内容方面有很多帮助。