-
-
Save AoJ/962972 to your computer and use it in GitHub Desktop.
Logger
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 | |
require "./Breto/libs/nette/loader.php"; | |
class CustomDump | |
{ | |
static public $file; | |
static function setFile($file) { | |
self::$file = $file; | |
} | |
static function log($a = NULL) | |
{ | |
$file = fopen(self::$file, "a+"); | |
foreach (func_get_args() as $arg) { | |
fwrite($file, Nette\Diagnostics\Debugger::dump($arg, TRUE)); | |
} | |
fclose($file); | |
} | |
} | |
class Foo | |
{ | |
public $prop = 'value'; | |
function test($arg) | |
{ | |
// hardcore ajax action | |
CustomDump::log($this, get_defined_vars()); | |
} | |
} | |
CustomDump::setFile('log.txt'); | |
$foo = new Foo; | |
$arg = 'a456sd'; | |
$foo->test($arg); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment