public static function debug(string $format)
    {
        if (!is_resource(self::$debug_stream))
            self::$debug_stream = fopen('php://output', 'w');

        $args = func_get_args();
        foreach ($args as $idx => &$arg)
        {
            if ($idx === 0)
                $arg .= PHP_SAPI === 'cli' ? "\n" : "<br>\n";

            if (!is_scalar($arg))
                $arg = static::str($arg);
        }

        array_unshift($args, self::$debug_stream);
        call_user_func_array('fprintf', $args);
    }
public static function debug(string $format)
    {
        if (!is_resource(self::$debug_stream))
            self::$debug_stream = fopen('php://output', 'w');

        $args = func_get_args();
        foreach ($args as $idx => &$arg)
        {
            if ($idx === 0)
                $arg .= PHP_SAPI === 'cli' ? "\n" : "<br>\n";

            if (!is_scalar($arg))
                $arg = static::str($arg);
        }

        array_unshift($args, self::$debug_stream);
        call_user_func_array('fprintf', $args);
    }
public static function debug ( string $ format ) { if ( ! is_resource ( self :: $ debug_stream ) ) self :: $ debug_stream = fopen ( 'php://output' , 'w' ) ; $ args = func_get_args ( ) ; foreach ( $ args as $ idx => & $ arg ) { if ( $ idx === 0 ) $ arg .= PHP_SAPI === 'cli' ? "\n" : "<br>\n" ; if ( ! is_scalar ( $ arg ) ) $ arg = static :: str ( $ arg ) ; } array_unshift ( $ args , self :: $ debug_stream ) ; call_user_func_array ( 'fprintf' , $ args ) ; }
Log an output message to a specified stream
@param string $format The formatting string
@param ... Arguments to fprintf. Non-scalar arguments will be converted to a string using WF::str
Log an output message to a specified stream