标签:sre sage environ debug rom except new 工具 message
class LogUtils {
//dart.vm.product
环境标识位 Release为true debug 为false static const bool isRelease = const bool.fromEnvironment("dart.vm.product"); static void d(String tag, Object message) { if (!isRelease) _printLog(tag, ‘D -> ‘, message); } static void i(String tag, Object message) { _printLog(tag, ‘I -> ‘, message); } static void e(String tag, Object message, {Exception e}) { _printLog(tag, ‘E -> ‘, message); } static void _printLog(String tag, String level, Object message) { StringBuffer sb = new StringBuffer(); sb..write(level)..write(tag ?? ‘‘)..write(‘: ‘)..write(message); print(sb.toString()); } }
标签:sre sage environ debug rom except new 工具 message
原文地址:https://www.cnblogs.com/loaderman/p/11532318.html