Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request for automatic unwinding of chained exceptions #35

Open
hderuiter opened this issue May 13, 2019 · 2 comments
Open

Feature request for automatic unwinding of chained exceptions #35

hderuiter opened this issue May 13, 2019 · 2 comments
Assignees

Comments

@hderuiter
Copy link

Dear Daniel,

I just recently started using Delphi.
Coming from a Java background, I definitely missed a decent logging framework, so I'm very glad you created LoggerPro. Thank you for your effort!

I was wondering if LoggerPro might support (in future editions) some kind of automatic nested exception unwinding (e.g. just passing the error object instead of a message). This way chained exceptions could be traced also.

Kind regards

@danieleteti
Copy link
Owner

Hi, thank you for your kind words.
Yes, it is planned, but I don't know when will be available.

@hderuiter
Copy link
Author

hderuiter commented May 13, 2019

Thank you for your quick reply.

For now I implemented it externally in the following fashion:

  try
  // some stuff...
  except
      on E: Exception do
      begin

        var msg: string := E.Message;
        var ex: Exception := E.InnerException;

        while ex.InnerException <> nil do
        begin
           msg := msg + sLineBreak + #9 + ex.Message;
           ex := ex.InnerException;
        end;

        Log.Error('Could not process log %s [%s]', [canonicalFileName, msg], LOG_TAG);
      end;
  end;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants