DataSift\Storyplayer\Console\ScriptConsole::logVardump PHP Method

logVardump() public method

an alternative to using PHP's built-in var_dump()
public logVardump ( string $name, mixed $var ) : void
$name string a human-readable name to describe $var
$var mixed the variable to dump
return void
    public function logVardump($name, $var)
    {
        // grab the output buffer
        ob_start();
        // dump the variable
        var_dump($var);
        // get the contents of the output buffer
        $output = ob_get_contents();
        // we're done with the output buffer
        ob_end_clean();
        // send the output to the default logger
        Log::write(Log::LOG_DEBUG, $name . ' => ' . $output);
    }