GitHub 저장소yungzhu/let_log

let_log

LetLog는 IDE 및 앱 내 표시를 지원하는 Flutter 로그 시스템이며, 로그 및 네트워크를 지원합니다

let_log 프로젝트 이미지
스타
46
포크
21
최근 푸시(UTC)
2022. 6. 9.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

let_log

LetLog is a logger that supports both IDE and in-app display, and supports log and network

Language: English | 中文简体

Getting Started

API inspired by web

Example code

// 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"}
    ]
  },
);

// clear log
// Logger.clear();

For a detailed example, please refer to here.

IDE Display results

Let Log

Display logs in the app

Widget build(BuildContext context) {
  return Logger();
}

For a detailed example, please refer to here.

App log

Let Log

App network

Let Log

App search

Let Log

Setting

Custom category names

// setting
Logger.enabled = false;
Logger.config.maxLimit = 50;
Logger.config.reverse = true;
Logger.config.printLog = false;
Logger.config.printNet = false;

// Set the names in ide print, can use emoji.
Logger.config.setPrintNames(
  log: "[😄Log]",
  debug: "[🐛Debug]",
  warn: "[❗Warn]",
  error: "[❌Error]",
  request: "[⬆️Req]",
  response: "[⬇️Res]",
);

// Set the names in the app, can use emoji.
Logger.config.setTabNames(
  log: "😄",
  debug: "🐛",
  warn: "❗",
  error: "❌",
  request: "⬆️",
  response: "⬇️",
);

Results:

Let Log

Feature

  • [x] Support for both IDE printing and in-app presentation

  • [x] Also supports logging, error, time statistics, network and other information output.

  • [x] Interface imitates the web console class, providing log, debug, warn interface, error, time, endTime, net, endNet, etc.

  • [x] Support for filtering log content by category

  • [x] Support for filtering log content by keywords

  • [x] Support for copy log content

  • [x] Serves as both Http and Socket

  • [x] Statistics for network support packet size, duration

  • [x] Support for custom log category symbols, you can use emoji sentiment as a sort if you like.

  • [x] Multi-colored output logs within the app to make error logs more visible

  • [x] Support for automatic switching between black and white skin according to the app

  • [x] Support for some custom logging settings

github

https://github.com/yungzhu/let_log

If you like it, give it a star, thanks.

yung GitHub avatar
GitHub 작성자

yung ↗

涉及Web开发,App跨平台,小游戏引擎,小程序引擎,最近在研究flutter技术

yungzhushenzhen
언어DartSwiftJavaKotlinObjective-C

분류

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗