Formula debugger… More addictive than heroin

Hum, probably not the best title in the world. But that’s the truth: for any Murex support person, the formula debugger has become very hard to live without.

What is Formula debugger?

I’ll have to assume that you are from another planet . The formula debugger is THE tool to use whether you are actually working (so useful) or just pretending (looks very serious and on the scale of Lazy Fridays Hangover I am Coming to Work but I am Still Asleep (LFHICWISA), it scores a 9 (only beaten by the Excel screensaver)).

As the formula debugger name could have led you to believe: It is used to debug formula. When you turn it on, whenever you are using functions which calls the pretrade, you will see a pop up with all the formulas executed as well as their resolution.

How does it work?

To turn it on, it is very simple, from your enduser session, do Help-Monitor-Formula debugger. You will get a pop-up stating: Formula debugging is now on.  (do the same steps to turn it off)

Now, very simply price a trade from ePad, or whatever you want to do, and a pop up will come up showing you the different formulas executed.

Even better (it’s like a double rainbow) if shows you the resolution of formulas. For example (first line is my formula, second one is the resolution details always starting with //)

IF fLFHICWISA>9. THEN sResults:=’Better than Excel Screensaver’

// IF 8.5>9. statement result is FALSE

You also get the content of the variables when they are assigned:


// legGetString(pointer,”Counterpart”) returned “HSBC”

And of course you also get the name of the formula being executed so you can check the formula you have been working on is properly being used by the pricing.

And the whole text is exportable to Notepad or you can also search through it.

Any more tips?

You are getting quite demanding, but I actually have 2 more things:

One is the obvious Clear button, to make sure that you only have as debugging output what you need to focus on (between 2 tests, just clear the window)

And the other one is to couple with the action button wf:XML refresh in the strategies/notpads (right click on the folder,Properties, Actions. Then you can add a button wf:XML refresh. Usually it is the last one in the list.

This button lets you reload all the changes you made in the formulas in a CONFIG session without having to exit eTradepad and re-enter.

Time for you to get cracking on new strategies and formulas!

The logs monster

Just to finish this week with a bit of lighter note: let’s talk about something actually quite painful in Murex: log files.

While you will be able to find everything you need as logs in Murex if someone helps you, to browse the logs for errors makes Indiana Jones job sort of trivial!
Indeed, Murex produces a lot of logs and unfortunately not always as detailed as you would have liked or sometimes not where you would expect. So here are few advice to get through them.

  • Most logs are under the… logs directory. But not all of them! find and grep will quickly become your best buddies on Linux/Unix to find where are the files.
  • And once you enter the logs directory, your first ls will bring out a massive list of log files. There are many of them and sometimes even in subdirectories. You could sneak in your porn folder in there, no one would ever be able to find it. Much safer than your accounting 2014 folder on your PC!
  • To navigate through the logs folder, again find and grep (I mostly use grep myself but that’s just me) are your friends.

I would say that most of the time, you should only go through the logs to search for something specific. Mxmlexchange crashed? Perfect go and search files with mxml, that narrows the scope considerably. There is too much noise and so many different logs that you cannot ‘just look’ at the logs to see if all services are running ok. The best example is if you have garbage collector on java turned on to verbose, then you will get loads and loads of high quality log: GC [5K -> 2k] (about 2 million times). I am waiting for an answer if I can turn these off. They make reading mxmlexchange logs extremely painful. Again grep is your friend, remember that you can use the -v option to filter out data from a file. You can also do grep on grep : grep ‘text to search’ filename | grep -v ‘string to filter out’. Very very useful. If I ever find the grep author, I owe him a beer. (well, probably more a truck of beers, but we’ll start with one).

Logs of logs? Probably the best would be to have some logs of logs. You just extract the logs you actually need to check and make a new log file, that would be probably the best way. I am sometimes considering as a solution.

Of course, some of you would come back and reply ‘what about errors.log?’. An example of meta-log, some services also put their errors in errors.log. But not all of them and you still get a lot of noise (looking at you RTBS). I’d stick to my grep for now.

Just for fun, I am wondering if I should print out all the logs generated by Murex in one day to show people the amount of data it creates. Maybe I could turn it into some cool ASCII art or that would replace my stock of wood for winter… Not sure and as my emails say ‘Print responsibly”, I doubt I will actually do it!