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

Clean up code for optimal logging integration #1

Open
tachyonlabs opened this issue Jan 15, 2020 · 0 comments
Open

Clean up code for optimal logging integration #1

tachyonlabs opened this issue Jan 15, 2020 · 0 comments

Comments

@tachyonlabs
Copy link
Contributor

tachyonlabs commented Jan 15, 2020

Many functions have a lot of return points due to having many error checks -- does the database exist, the table exist, is the token string empty, does the user exist, is the token already registered to a different user, etc. etc. -- so figure out good places to log. A function calling that function could do it, but there might be additional error checks in the calling function as well.

There's also the issue that log_action() is expecting either a wp_error or a string, so that could make it hard to add additional details to a wp_error for example whether associating a token with a user had happened via a WordPress dashboard submenu page or the API.

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

1 participant