import 'dart:developer'; import 'package:logging/logging.dart'; final _logging = Logger("dartTest"); void main() { Logger.root.level = Level.ALL; // defaults to Level.INFO Logger.root.onRecord.listen((record) { print('${record.level.name}: ${record.time}: ${record.message}'); }); Future.delayed(const Duration(seconds: 3), ()=> "future test") .then((value) => _logging.info(value)); // Future.delayed(const Duration(seconds: 2), () { // //return "hi world!"; // throw AssertionError("Error"); // }).then((data) { // //执行成功会走到这里 // print("success"); // }).catchError((e) { // //执行失败会走到这里 // print(e); // }); }