当前位置:网站首页>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 *');
}
}
}
边栏推荐
- GZIPInputStream 类源码分析
- loadrunner-controller-目标场景Schedule配置
- 如何将亚马逊广告添加到您的 WordPress 网站(3 种方法)
- 富文本编辑器Tinymce
- (C语言)程序环境和预处理
- postgresql 生成随机日期,随机时间
- Flink1.15 source code reading flink-clients - flink command line help command
- loadrunner脚本--添加集合点
- Come n times with the sword--05. Replace spaces
- 二叉树的搜索与回溯问题(leetcode)
猜你喜欢
随机推荐
如何在 TiDB Cloud 上使用 Databricks 进行数据分析 | TiDB Cloud 使用指南
js部门预算和支出雷达图
多版本node的安装与切换详细操作
matlab常用符号用法总结
【节选】吴恩达给出的AI职业生涯规划
js右侧圆点单页滚动介绍页面
Qt 编译错误:C2228: “.key”的左边必须有类/结构/联合
spark filter
loadrunner脚本--添加检查点
Day113.尚医通:用户认证、阿里云OSS、就诊人管理
使用turtle画按钮
Implement a thread pool
js以变量为键
Progressive Web App(PWA)
文件的逻辑结构与物理结构的对比与区别
js实现2020年元旦倒计时公告牌
The big-eyed Google Chrome has also betrayed, teach you a trick to quickly clear its own ads
js implements the 2020 New Year's Day countdown bulletin board
来n遍剑指--05. 替换空格
Build finished with errors/Executable Not Found