php debug log function

PHOTO EMBED

Wed Jun 15 2022 18:57:51 GMT+0000 (Coordinated Universal Time)

Saved by @nladev #php

function debug($msg)
	{
		$ip = $_SERVER["REMOTE_ADDR"];
		$t = date("Y-m-D h:i:s");
		$log_file = storage_path("tmp/debug.log");
		if (is_array($msg)) {
			$msg = var_export($msg, true);
		}
		file_put_contents($log_file, "\n----------\n$t ($ip): $msg \n", FILE_APPEND);
	}
content_copyCOPY

debug php messages at api,command, etc ...