Last active
July 3, 2019 10:51
-
-
Save doganoo/ff7740ceb807547c84a7945738728491 to your computer and use it in GitHub Desktop.
snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$loggggggggger = function ($message): void { | |
if (is_array($message)) $message = print_r($message, true); | |
if (is_bool($message)) $message = $message ? "true" : "false"; | |
if ($message instanceof \Exception) $message = $message->getTraceAsString(); | |
$dateTime = (new \DateTime())->format("Y-m-d H:i:s"); | |
file_put_contents("/var/log/application.log", "$dateTime : $message\n\n\n\n", FILE_APPEND); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment