GitHub-Repositoryyungzhu/let_log

let_log

LetLog ist ein Flutter-Protokollsystem, das sowohl die Anzeige im IDE als auch in der App unterstützt und Protokolle sowie Netzwerk unterstützt

Projektcover von let_log
Sterne
46
Forks
21
Letzter Push (UTC)
09.06.2022
Projektstatus
Aktiv

Original-README

Englischer Projektschnappschuss. Aktuelle Inhalte auf 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-Autor

yung ↗

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

yungzhushenzhen
SprachenDartSwiftJavaKotlinObjective-C

Kategorien

Von diesem Repository veröffentlichte Pakete

Verwendete Abhängigkeiten

Abhängigkeiten 2 Einträge

Wie wähle ich ein passendes Repository?

Nach Anwendungsfall filtern, Aktivität vergleichen und vor der Nutzung das Originalprojekt prüfen.

  1. Nach Name, Autor oder Beschreibung suchen und nach Thema eingrenzen.
  2. Sterne, Forks und letzte Pushes vergleichen. Sterne zeigen Interesse, garantieren aber keine Qualität.
  3. Vor der Nutzung README, Lizenz und Issues auf GitHub prüfen.

Quellen und Pflege

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

GitHub Docs — About repositories ↗