当前位置:网站首页>Dart Log tool class
Dart Log tool class
2022-07-31 09:48:00 【kicinio】
一个简易的Log工具类,代码很短,如下:
import 'package:flutter/foundation.dart';
class Log{
static void info<T>(T content){
DateTime date = new DateTime.now();
if (kDebugMode) {
print('------> * [INFO] ${
date.hour}:${
date.minute}:${
date.second}:${
date.millisecond} || $content *');
}
}
static void debug<T>(T content){
DateTime date = new DateTime.now();
if (kDebugMode) {
print('------> * [DEBUG] ${
date.hour}:${
date.minute}:${
date.second}:${
date.millisecond} || $content *');
}
}
static void warn<T>(T content){
DateTime date = new DateTime.now();
if (kDebugMode) {
print('------> * [WARN] ${
date.hour}:${
date.minute}:${
date.second}:${
date.millisecond} || $content *');
}
}
static void error<T>(T content){
DateTime date = new DateTime.now();
if (kDebugMode) {
print('------> * [ERROR] ${
date.hour}:${
date.minute}:${
date.second}:${
date.millisecond} || $content *');
}
}
}
边栏推荐
- 踩水坑2 数据超出long long
- Kotlin—基本语法(二)
- What is the encoding that starts with ?
- 【TCP/IP】Network Model
- The big-eyed Google Chrome has also betrayed, teach you a trick to quickly clear its own ads
- [ 动词词组 ] 合集
- GZIPInputStream 类源码分析
- 混合型界面:对话式UI的未来
- 关于挂载EXfat文件格式U盘失败的问题
- Canvas particles change various shapes js special effects
猜你喜欢
随机推荐
[NLP] Interpretation of Transformer Theory
Kotlin—基本语法 (五)
安装gnome-screenshot截图工具
The future of the hybrid interface: conversational UI
文件管理:目录管理
Flink1.15 source code reading flink-clients - flink command line help command
Emotional crisis, my friend's online dating girlfriend wants to break up with him, ask me what to do
浓眉大眼的谷歌 Chrome 也叛变了,教你一招快速清除其自带广告
[ 动词词组 ] 合集
【节选】吴恩达给出的AI职业生涯规划
ReentrantLock
感情危机,朋友的网恋女友要和他闹分手,问我怎么办
生成随机数
【机器学习】用特征量重要度(feature importance)解释模型靠谱么?怎么才能算出更靠谱的重要度?
VMware下安装win10启动后进入Boot Manger界面如何解决
js radar chart statistical chart plugin
Day113.尚医通:用户认证、阿里云OSS、就诊人管理
postgresql generate random date, random time
loadrunner-Controller负载测试-各模块功能记录01测试场景设计
【Excel】生成随机数字/字符









