Skip to content

Instantly share code, notes, and snippets.

@nuriye
Created May 7, 2019 07:17
Show Gist options
  • Save nuriye/d74ccd7444d7ae5e5175a9be8da19519 to your computer and use it in GitHub Desktop.
Save nuriye/d74ccd7444d7ae5e5175a9be8da19519 to your computer and use it in GitHub Desktop.
function log_result($message) {
$pluginLog = wp_upload_dir()["basedir"] . '/wps_log_dev';
$pluginLogContents = file_get_contents($pluginLog);
$date = new DateTime();
$date = $date->setTimezone(new DateTimeZone('Europe/Berlin'));
$pluginLogContents .= $date->format('[d/M/Y:H:i:s\Z]') ."(Europe/Berlin) - " . $message . " --\n";
file_put_contents($pluginLog, $pluginLogContents);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment