Skip to content

Instantly share code, notes, and snippets.

@aiiddqd
Created October 8, 2019 16:35
Show Gist options
  • Select an option

  • Save aiiddqd/08b259f5039e83ab64cea11f68b8b304 to your computer and use it in GitHub Desktop.

Select an option

Save aiiddqd/08b259f5039e83ab64cea11f68b8b304 to your computer and use it in GitHub Desktop.
Fast logger for WordPress. Set up as file to wp-content/mu-plugins/
<?php
add_action('u/log', function($msg, $data = []){
error_log( PHP_EOL . $msg);
if(!empty($data)){
ob_start();
echo PHP_EOL;
var_dump($data);
error_log(ob_get_clean());
}
}, 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment