let_log 1.0.2 let_log: ^1.0.2 copied to clipboard
LetLog is a log system that supports both IDE and in-app display, and supports log and network.
let_log #
LetLog is a log system that supports both IDE and in-app display, and supports log and network
Getting Started #
API inspired by web
Example code
// log
Console.log("this is log");
// debug
Console.debug("this is debug", "this is debug message");
// warn
Console.warn("this is warn", "this is a warning message");
// error
Console.error("this is error", "this is a error message");
// test error
try {
final aa = {};
aa["aaa"]["sdd"] = 10;
} catch (a, e) {
Console.error(a, e);
}
// time test
Console.time("timeTest");
Console.endTime("timeTest");
// log net work
Console.net(
"api/user/getUser",
data: {"user": "yung", "pass": "xxxxxxx"},
head: null,
);
Console.endNet(
"api/user/getUser",
data: {
"users": [
{"id": 1, "name": "yung", "avatar": "xxx"},
{"id": 2, "name": "yung2", "avatar": "xxx"}
]
},
);
// log net work
Console.net("ws/chat/getList", data: {" chanel": 1}, type: "Socket");
Console.endNet(
"ws/chat/getList",
data: {
"users": [
{"id": 1, "name": "yung", "avatar": "xxx"},
{"id": 2, "name": "yung2", "avatar": "xxx"}
]
},
);
// clear log
// Console.clear()
For a detailed example, please refer to here.
IDE Display results
Display logs in the app
Widget build(BuildContext context) {
return Console();
}
For a detailed example, please refer to here.
App log
App network
App search
Setting
Custom category names
// setting
// Console.enabled = false;
// Console.maxLimit = 10;
// Console.showAsReverse = true;
Console.setNames(
log: "😄",
debug: "So_1F41B",
warn: "❗",
error: "❌",
request: "So_2B06_️",
response: "⬇️",
);
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 #
If you like it, give it a star, thanks.