From 476aea0586d6d80794e37b5b20eb1ad0a25bc468 Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期一, 19 十二月 2022 15:56:04 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/LogService.cs | 18 +++++++++++++++++-
1 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/WebAPI/LogService.cs b/WebAPI/LogService.cs
index 9168f4d..7762f83 100644
--- a/WebAPI/LogService.cs
+++ b/WebAPI/LogService.cs
@@ -11,7 +11,23 @@
public class LogService
{
private static readonly object lockObj = new object();
-
+
+ public static void WriteAsync(object obj, string filePath = "Vlog", bool isAppend = true)
+ {
+ Task.Run(() =>
+ {
+ Write(obj, filePath, isAppend);
+ });
+ }
+
+ public static void WriteAsync<T>(object obj, string filePath = "Vlog", bool isAppend = true)
+ {
+ Task.Run(() =>
+ {
+ Write(obj, $@"{filePath}\{typeof(T).Name}", isAppend);
+ });
+ }
+
#region 鏃ュ織
public static void Write(object obj, string filePath = "Vlog", bool isAppend = true)
{
--
Gitblit v1.9.1