How to control QuickFix printouts
Asked Answered
F

4

6

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☺)
Fourscore answered 1/6, 2011 at 15:16 Comment(0)
C
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)
Calvinna answered 2/1, 2013 at 12:40 Comment(1)
Thank you. I had a hard time trying to figure out where those shitty prints come from.Danczyk
C
6

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

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

Conferral answered 10/7, 2012 at 5:55 Comment(3)
These settings appear in QuickFix/J config docs, but not in QuickFix config docs. Do you know if they also work there albeit undocumented?Fourscore
Would be good if you could try them in your scenario and share the results with the community.Conferral
Is there a way to redirect the output for ScreenLogShowOutgoing=Y to a FILE/parameter instead of console?Cutout
M
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.

Mccullum answered 1/6, 2011 at 15:44 Comment(3)
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 logsFourscore
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.Fourscore
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 itselfFourscore
C
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.

Conferral answered 30/8, 2011 at 19:44 Comment(1)
Any chance there could be a (boolean) configuration for this in the config file?Fourscore

© 2022 - 2024 — McMap. All rights reserved.