log-firebug.php 571 B

1234567891011121314151617181920212223
  1. <script type="text/javascript">
  2. /*<![CDATA[*/
  3. if(typeof(console)=='object')
  4. {
  5. console.<?php echo $this->collapsedInFireBug?'groupCollapsed':'group'; ?>("應用程式日誌");
  6. <?php
  7. foreach($data as $index=>$log)
  8. {
  9. $time=date('H:i:s.',$log[3]).(int)(($log[3]-(int)$log[3])*1000);
  10. if($log[1]===CLogger::LEVEL_WARNING)
  11. $func='warn';
  12. elseif($log[1]===CLogger::LEVEL_ERROR)
  13. $func='error';
  14. else
  15. $func='log';
  16. $content=CJavaScript::quote("[$time][$log[1]][$log[2]] $log[0]");
  17. echo "\tconsole.{$func}(\"{$content}\");\n";
  18. }
  19. ?>
  20. console.groupEnd();
  21. }
  22. /*]]>*/
  23. </script>