LogDisplay order

Feb 10, 2014 at 4:16 PM
Hi,

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?

Thanks
Coordinator
Feb 10, 2014 at 7:12 PM
Hi,

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

-Govert
Feb 10, 2014 at 7:58 PM
Hi,

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.

Thanks.
Coordinator
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?

-Govert
Feb 11, 2014 at 7:26 PM
Hi,

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:

ExcelDna.Logging.LogDisplay.WriteLine(e.Message);
ExcelDna.Logging.LogDisplay.WriteLine(e.StackTrace);

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?
Coordinator
Feb 14, 2014 at 6:30 PM
Hi,

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.

-Govert