Created
May 22, 2014 17:07
-
-
Save datamafia/d15c7ed1d3fe61994f69 to your computer and use it in GitHub Desktop.
Simple Work in Progress PHP Error Reporting to Terminal
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
// (c) copyright Data Mafia LLC MIT license : http://opensource.org/licenses/MIT | |
class foo{ | |
/* Deliver message via PHP error_log | |
* @param $msg : optional. string, obj, or array | |
* @return : void | |
*/ | |
function e($msg=false){ | |
if(!$msg){ | |
$msg = 'at line number '.__LINE__; | |
} | |
if(is_object($msg) || is_array($msg)){ | |
$msg = var_export($msg, true); | |
} | |
error_log('[ADD SOMETHING HERE] file : ' | |
.__file__.' class : '.get_class($this).' method : '.__FUNCTION__ | |
.' custom message :'.$msg | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment