LogDisplay order

Feb 10, 2014 at 4:16 PM

I am using ExcelDna.Logging.LogDisplay.WriteLine to log error messages in the log window, but it seems that the most recent message is logged at the bottom and I think it's a bit inconvenient to have to scroll to the bottom to see what went wrong.

Is there a way (or a plan) to change the log order or provide a way to specify logging order?

Feb 10, 2014 at 7:12 PM

How do you suggest the call should look to change the display order?

Feb 10, 2014 at 7:58 PM

Thanks for considering the request.

A quick thought, without thinking too much, is just to provide an enum for user to set once at the start?

ExcelDna.Logging.LogDisplay.DisplayOrder = RECENT_FIRST/RECENT_LAST;

Or this enum can also be specified in the dna file since it shouldn't be allowed to change once it's set.

Feb 10, 2014 at 9:26 PM
OK - I've put this into the latest check-in: https://exceldna.codeplex.com/SourceControl/list/changesets.
    LogDisplay.DisplayOrder = DisplayOrder.NewestFirst;
Could you perhaps take a look?

Feb 11, 2014 at 7:26 PM

I tried it. It works fine except one issue which I don't think is a major one, but I would still like to mention.

I have:


With default NewestLast, it prints stack trace with inner most function call at the top and outer most function call at the bottom. So if function a calls b calls c and c throws exception, it prints:
at c
at b
at a.

With NewestFirst, I expected this order to remain same, as after all, e.exception is a single big string. But it prints:
at a
at b
at c.

It's not an issue for me as any order within stacktrace is fine with me, but I don't understand why stacktrace, which is a single string, gets reversed line by line.

May be I am missing something?
Feb 14, 2014 at 6:30 PM

OK - I've improved it more, and now the lines of new entries you add will be displayed in the proper sequence. If you change the DisplayOrder with existing text in the dialog it will still reverse the order, but new stuff added will be right.

I think that's reasonable for now.