Re: [Quickfix-developers] Logging in QuickFIX
Brought to you by:
orenmnero
|
From: Caleb E. <cal...@gm...> - 2007-09-12 17:36:55
|
On 9/12/07, Erich <gra...@al...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > I've been doing some testing of QuickFIX performance and that suggests that I > might want to run QuickFIX with a logging object. Now the only way I've > found of doing this is to use the constructor for my acceptor without the > logging object. Now this is a bit clunky as if I want to be able to make > logging a configurabel option, e.g. > > If (logging) > { > FIX::ThreadSocketAcceptor acceptor(fixApp, storeFactory, settings, > logFactory); > ... > } > else > { > FIX::ThreadSocketAcceptor acceptor(fixApp, storeFactory, settings); > acceptor.start(); > ... > } > > Is there a way of controlling this is the QuickFIX config? If I don't > specify a file log path the app exits and I haven't found any other setting > that seesm to relate to this. No, this can't be done purely with configuration, but you could make that code a bit cleaner doing something like (untested, might need some casts): NullLogFactory null_factory; FileLogFactory file_factory; LogFactory* log_factory = logging ? &file_factory : &null_factory; ThreadedSocketAcceptor acceptor(fixApp, storeFactory, settings, *log_factory); The implementation of the (unfortunately mythical) 'NullLogFactory' is left as an exercise for the reader :^) -- Caleb Epstein |