Skip to content

Instantly share code, notes, and snippets.

@dancameron
Created January 6, 2020 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dancameron/601fa8344ac7292c2518fc31492a0170 to your computer and use it in GitHub Desktop.
Save dancameron/601fa8344ac7292c2518fc31492a0170 to your computer and use it in GitHub Desktop.
Error Logging for Help Scout Desk Troubleshooting
<?php // don't include this in your functions.php, since the start of the file should already have it
function _hsd_api_log( $data, $endpoint ) {
error_log( '************* HSD API LOG *************' );
error_log( 'data' . print_r( $data, true ) );
error_log( 'endpoint' . print_r( $endpoint, true ) );
error_log( '************* HSD API LOG END *************' );
}
add_filter( 'hsd_v2_api_request_params', '_hsd_api_log', 10, 2 );
add_filter( 'hsd_v2_api_request', '_hsd_api_log', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment