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

how to cath stack trace info? #43

Open
kevinsui581 opened this issue Aug 3, 2020 · 2 comments
Open

how to cath stack trace info? #43

kevinsui581 opened this issue Aug 3, 2020 · 2 comments

Comments

@kevinsui581
Copy link

i have include iiExceptionInfo, iiExceptionStackTrace, in sentry,can not find stack trace info!

@kevinsui581
Copy link
Author

I have read source code, but can't found send stacktrace info to sentry; I add jcldebug into my project, so it can create stack trace info, i want to know how to send the stack trace info with quick logger to sentry?

@vesnx
Copy link

vesnx commented Jun 20, 2024

Try the Jedi library

procedure LogException(const E: Exception);
var
  msg: string;
  StackTrace: string;
begin

  if not IsNullOrEmpty(E.StackTrace) then
    StackTrace := E.StackTrace
  else
  begin
   {$IFDEF MSWINDOWS}
   {$IFDEF JclDebugEnabled }
     var list := TStringList.Create;
     try
        JclLastExceptStackListToStrings(list,True, True, True, False);
        StackTrace := list.Text;
     finally
        list.Free;
     end;
     {$ENDIF}
     {$ENDIF}
  end;

  msg := Format('%s: %s on %s', [E.ClassName, E.Message,StackTrace]);
  Log(msg, etException);
end;

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

No branches or pull requests

2 participants