当前位置:网站首页>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 *');
}
}
}
边栏推荐
猜你喜欢
随机推荐
浓眉大眼的谷歌 Chrome 也叛变了,教你一招快速清除其自带广告
Kotlin—基本语法 (五)
Kotlin—基本语法(二)
富文本编辑器Tinymce
生成随机数
Come n times - 09. Implement queues with two stacks
安装gnome-screenshot截图工具
内联元素居中
VMware下安装win10启动后进入Boot Manger界面如何解决
MySQL 高级(进阶) SQL 语句 (一)
MySQL (2)
Kotlin入门介绍篇
Build finished with errors/Executable Not Found
postgresql 范围查询比索引查询快吗?
GVINS论文阅读笔记
来n遍剑指--05. 替换空格
感情危机,朋友的网恋女友要和他闹分手,问我怎么办
postgresql generate random date, random time
MySQL 视图(详解)
Canvas particles change various shapes js special effects









