2012-11-03 132 views
4

如何在Dart中使用console.error(foo);Dart中的console.error()?

print()方法變得非常接近,但它不完全是我想要的。我想要通知一個錯誤和圖標以及堆棧跟蹤。

回答

9

這其實很簡單,在飛鏢的事:

import 'dart:html'; 

main() { 
    window.console.error('Something bad occurred'); 
}