基础库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 4 години
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import 'package:zhiying_comm/zhiying_comm.dart';
  2. class LogUtil {
  3. static void test() {
  4. // log
  5. Logger.log("this is log");
  6. // debug
  7. Logger.debug("this is debug", "this is debug message");
  8. // warn
  9. Logger.warn("this is warn", "this is a warning message");
  10. // error
  11. Logger.error("this is error", "this is a error message");
  12. // test error
  13. try {
  14. final test = {};
  15. test["test"]["test"] = 1;
  16. } catch (a, e) {
  17. Logger.error(a, e);
  18. }
  19. // time test
  20. Logger.time("timeTest");
  21. Logger.endTime("timeTest");
  22. // log net work
  23. Logger.net(
  24. "api/user/getUser",
  25. data: {"user": "yung", "pass": "xxxxxx"},
  26. );
  27. Logger.endNet(
  28. "api/user/getUser",
  29. data: {
  30. "users": [
  31. {"id": 1, "name": "yung", "avatar": "xxx"},
  32. {"id": 2, "name": "yung2", "avatar": "xxx"}
  33. ]
  34. },
  35. );
  36. // log net work
  37. Logger.net("ws/chat/getList", data: {"chanel": 1}, type: "Socket");
  38. Logger.endNet(
  39. "ws/chat/getList",
  40. data: {
  41. "users": [
  42. {"id": 1, "name": "yung", "avatar": "xxx"},
  43. {"id": 2, "name": "yung2", "avatar": "xxx"}
  44. ]
  45. },
  46. );
  47. }
  48. }