0

In Java or C# you could use compositelogfactory to use both screenlogfactory and filelogfactory to write logs to both a log file and to the screen

QuickFix.ILogFactory logFactory = new QuickFix.CompositeLogFactory(settings);
logFactory = new CompositeLogFactory(
 new LogFactory[] { new ScreenLogFactory(settings),
 new FileLogFactory(settings)});

However in the Python version (SWIG C++ version), I can't find the CompositeLogFactory. Is this not available or is it possible to achieve the same functionality in a different (but similar) way through Python QuickFix?

BigChief
  • 1,413
  • 4
  • 24
  • 37

1 Answers1

2

The Python version simply wraps the C++ lib in Python bindings.

The C++ version doesn't have a CompositeLogFactory, so the Python-wrapped version doesn't have it either.

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
  • Thanks, so it is not possible to have both the logfactories active in quickfix cpp/python?? – BigChief May 14 '20 at 06:46
  • 1
    I don't know if Python/SWIG allows you to write a Python class that is a subclass of a C++ class. But if you can, then it would be pretty easy to write your own implementation of the Log interface that delegates to instantiations of ScreenLog and FileLog. – Grant Birchmeier May 15 '20 at 14:11
  • I don't know how to do it but if you have a sample I would be happy to receive it – BigChief May 19 '20 at 10:57
  • 1
    Sorry, I'm not a python programmer. – Grant Birchmeier May 19 '20 at 13:36
  • And my cpp knowledge is not at a level that I could write this. Probably the drawback of using swig. – BigChief May 25 '20 at 16:13