static public function printDebugReport( $as_html = true )
    {
        if ( !eZTemplate::isTemplatesUsageStatisticsEnabled() )
            return '';

        $stats = '';
        if ( $as_html )
        {
            $stats .= '<h3>CSS/JS files loaded with "ezjscPacker" during request:</h3>';
            $stats .= '<table id="ezjscpackerusage" class="debug_resource_usage" title="List of used files, hover over italic text for more info!">';
            $stats .= '<tr><th>Cache</th><th>Type</th><th>Packlevel</th><th>SourceFiles</th></tr>';
        }
        else
        {
            $stats .= "CSS/JS files loaded with 'ezjscPacker' during request\n";
            $stats .= sprintf( "%-40s%-40s%-40s\n", 'Cache', 'Type', 'Packlevel' );
        }

        foreach( self::$log as $data )
        {
            $extension = $data['file_extension'] === '.js' ? 'JS' : 'CSS';
            if ( $as_html )
            {
                $sourceFilesStats = self::printDebugReportFiles( $data, $as_html );
                $cache = $data['cache_path'] === '' ? ''
                                                    : "<span class='debuginfo' title='Full path: {$data['cache_path']}'>{$data['cache_hash']}</span>";
                $stats .= "<tr class='data'><td>{$cache}</td><td>{$extension}</td><td>{$data['pack_level']}</td><td>{$sourceFilesStats}</td></tr>";
            }
            else
            {
                $stats .= sprintf( "%-40s%-40s%-40s\n", $data['cache_hash'], $extension, $data['pack_level'] );
            }
        }

        if ( $as_html )
        {
            $stats .= '</table>';
        }

        return $stats;
    }