当前位置:网站首页>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 *');
}
}
}
边栏推荐
- P5231 [JSOI2012]玄武密码(SAM 经典运用)
- loadrunner-controller-手动场景Schedule配置
- GCD简单了解
- Andoird开发--指南针(基于手机传感器)
- VMware下安装win10启动后进入Boot Manger界面如何解决
- 【RISC-V】risc-v架构学习笔记(架构初学)
- Flink1.15 source code reading - PER_JOB vs APPLICATION execution process
- ReentrantLock
- PyQt5快速开发与实战 9.4 Matplotlib在PyQt中的应用
- Redis集群-哨兵模式原理(Sentinel)
猜你喜欢
随机推荐
Kotlin—基本语法(一)
Chapter VII
Redis集群-哨兵模式原理(Sentinel)
matlab常用符号用法总结
多版本node的安装与切换详细操作
【职场杂谈】售前工程师岗位的理解杂谈
js right dot single page scrolling introduction page
Scala basics [seq, set, map, tuple, WordCount, queue, parallel]
djangoWeb应用框架+MySQL数据4
The big-eyed Google Chrome has also betrayed, teach you a trick to quickly clear its own ads
postgresql 范围查询比索引查询快吗?
项目管理工具之燃尽图:动态考核团队工作能力
【软考软件评测师】2012综合知识历年真题
来n遍剑指--05. 替换空格
踩水坑2 数据超出long long
Dart Log工具类
【Excel】生成随机数字/字符
NowCoderTOP17-22 二分查找/排序——持续更新ing
一些计时软件,生产力工具
感情危机,朋友的网恋女友要和他闹分手,问我怎么办









