Created
May 11, 2017 08:30
-
-
Save noname007/f7d2f2c8842ba1fd3e668f0de47ea56a to your computer and use it in GitHub Desktop.
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 | |
| function log_error_msg($msg) | |
| { | |
| print_r($msg); | |
| $_log_message[] = $msg; | |
| $info = debug_backtrace(); | |
| $space = str_repeat(' ',4); | |
| foreach ($info as $i){ | |
| $file = isset($i['file']) ? $i['file'] : ''; | |
| $line = isset($i['line']) ? $i['line'] : ''; | |
| $class =isset($i['class']) ? $i['class'] : ''; | |
| $function = isset($i['function']) ?$i['function'] : ''; | |
| $sep = isset($i['object']) ? "->" : "::" ; | |
| $_log_message[]= "$space in $file:$line $class$sep$function()"; | |
| } | |
| log_msg('[error]'.implode(PHP_EOL,$_log_message)); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment