let_log

Last updated:

0 purchases

let_log Image
let_log Images
Add to Cart

Description:

let log

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();
copied to clipboard

For a detailed example, please refer to here.

IDE Display results

Display logs in the app
Widget build(BuildContext context) {
return Logger();
}
copied to clipboard

For a detailed example, please refer to here.

App log

App network

App search

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: "⬇️",
);
copied to clipboard
Results:

Feature #


Support for both IDE printing and in-app presentation


Also supports logging, error, time statistics, network and other information output.


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


Support for filtering log content by category


Support for filtering log content by keywords


Support for copy log content


Serves as both Http and Socket


Statistics for network support packet size, duration


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


Multi-colored output logs within the app to make error logs more visible


Support for automatic switching between black and white skin according to the app


Support for some custom logging settings


github #

https://github.com/yungzhu/let_log

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

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.