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

Add FileDiagnosticLogger to assist with debugging the SDK #2242

Merged
merged 3 commits into from Mar 21, 2023

Conversation

mattjohnsonpint
Copy link
Contributor

Sometimes when debugging, I want to capture the log output to a file. Copy/paste from console isn't always possible (depending on app type), and even when it is, It could be mixed with other console output, or it could be truncated due to size of the console buffer.

This adds a FileDiagnosticLogger that writes diagnostic info to the specified file. For example:

    options.Debug = true;
    options.DiagnosticLogger = new FileDiagnosticLogger("log.txt");

Optional parameters can be used to set log level, or to write to both file and console simultaneously.

@github-actions
Copy link
Contributor

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 0efb29d

Copy link
Collaborator

@vaind vaind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattjohnsonpint
Copy link
Contributor Author

Docs PR staged here:

getsentry/sentry-docs#6493

@mattjohnsonpint mattjohnsonpint merged commit f7800b8 into main Mar 21, 2023
@mattjohnsonpint mattjohnsonpint deleted the feat/file-diagnostic-logger branch March 21, 2023 20:35
@bruno-garcia
Copy link
Member

The docs PR never got merged: getsentry/sentry-docs#6493

@mattjohnsonpint
Copy link
Contributor Author

It will after this is released. 😉

@bruno-garcia
Copy link
Member

oh I saw the message above was 2 weeks ago, assume the code was live for ages

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

Successfully merging this pull request may close these issues.

None yet

3 participants