diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj index 78ebc041b..628f27c2b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Learun.Util.csproj @@ -95,6 +95,7 @@ + @@ -154,6 +155,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Log/LogHelper.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Log/LogHelper.cs new file mode 100644 index 000000000..6261c1c0d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Util/Learun.Util/Log/LogHelper.cs @@ -0,0 +1,33 @@ +using System; +using System.IO; + +namespace Learun.Util.Log +{ + public class LogHelper + { + public static void Info(string msg) + { + try + { + #region log + //文件路径 + string path = Path.Combine(Directory.GetCurrentDirectory(), "logs"); + if (!Directory.Exists(path)) + { + Directory.CreateDirectory(path); + } + + //文件 + string fileName = Path.Combine(path, $"{DateTime.Now:yyyyMMdd}.log"); + string message = $"{DateTime.Now:yyyy-MM-dd HH:mm:ss} logInfo:{msg}。{Environment.NewLine}"; + File.AppendAllText(fileName, message); + #endregion + } + catch + { + + + } + } + } +}