using System; using System.IO; using System.Threading.Tasks; namespace Core.Util
{ /// <summary> /// 日志帮助类 /// </summary> public static class LogHelper { ///
<summary> /// 写入日志到本地TXT文件 /// 注:日志文件名为"A_log.txt",目录为根目录 /// </summary> ///
<param name="log">日志内容</param> public static void WriteLog_LocalTxt(string log)
{ Task.Run(() => { string filePath = Path.Combine(AppDomain.CurrentDomain.
BaseDirectory, "A_log.txt"); string logContent = $
"{DateTime.Now.ToCstTime().ToString("yyyy-MM-dd HH:mm:ss")}:{log}\r\n"; File.
AppendAllText(filePath, logContent); }); } } }

技术
©2019-2020 Toolsou All rights reserved,
java四大函数式接口(重点,简单)html写樱花树,写樱花树的作文HashMap详解某东14薪变16薪,是诚意还是套路?浏览器内核(理解)让人意想不到的Python之樱花树(turtle库的华丽样式)os模块的简单使用