5

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☺)
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359

4 Answers4

8

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)
bavaza
  • 10,319
  • 10
  • 64
  • 103
  • Thank you. I had a hard time trying to figure out where those shitty prints come from. – LXJ Aug 24 '23 at 20:44
6

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

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

Groovy
  • 516
  • 5
  • 16
  • These settings appear in [QuickFix/J config docs](http://www.quickfixj.org/quickfixj/usermanual/1.5.1/usage/configuration.html), but not in [QuickFix config docs](http://www.quickfixengine.org/quickfix/doc/html/configuration.html). Do you know if they also work there albeit undocumented? – Jonathan Livni Jul 10 '12 at 06:33
  • Would be good if you could try them in your scenario and share the results with the community. – Groovy Jul 10 '12 at 11:10
  • Is there a way to redirect the output for ScreenLogShowOutgoing=Y to a FILE/parameter instead of console? – Sakshi Singla May 03 '18 at 12:15
1

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.

DumbCoder
  • 5,696
  • 3
  • 29
  • 40
  • I'm sure these are not my logs. re your first link - FileLogPath didn't seem to have any influence. re your second link - FileStorePath changes where the body,header,seqnums,session files are stored and has no influence on these logs – Jonathan Livni Jun 03 '11 at 16:59
  • It seems you're right regarding the cout in log.h. The problem is that I'm using an installed version of quickfix with SWIG bindings for Python, so I'm unable to recompile quickfix with these cout statements commented out. I was hoping there was a configuration for this. – Jonathan Livni Jun 09 '11 at 11:12
  • I tried going into the SWIG generated file and cutting off the connection between the Python exposed onIncoming() and the C++ onIncoming() but it didn't help - I think the call to it is made from within quickfix itself – Jonathan Livni Jun 09 '11 at 11:13
0

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.

Groovy
  • 516
  • 5
  • 16