|
-
- import 'package:zhiying_comm/zhiying_comm.dart';
-
- class LogUtil {
- static void test() {
- // log
- Logger.log("this is log");
-
- // debug
- Logger.debug("this is debug", "this is debug message");
-
- // warn
- Logger.warn("this is warn", "this is a warning message");
-
- // error
- Logger.error("this is error", "this is a error message");
-
- // test error
- try {
- final test = {};
- test["test"]["test"] = 1;
- } catch (a, e) {
- Logger.error(a, e);
- }
-
- // time test
- Logger.time("timeTest");
- Logger.endTime("timeTest");
-
- // log net work
- Logger.net(
- "api/user/getUser",
- data: {"user": "yung", "pass": "xxxxxx"},
- );
- Logger.endNet(
- "api/user/getUser",
- data: {
- "users": [
- {"id": 1, "name": "yung", "avatar": "xxx"},
- {"id": 2, "name": "yung2", "avatar": "xxx"}
- ]
- },
- );
-
- // log net work
- Logger.net("ws/chat/getList", data: {"chanel": 1}, type: "Socket");
- Logger.endNet(
- "ws/chat/getList",
- data: {
- "users": [
- {"id": 1, "name": "yung", "avatar": "xxx"},
- {"id": 2, "name": "yung2", "avatar": "xxx"}
- ]
- },
- );
- }
- }
|