Просмотр исходного кода

😎调整任务执行显示信息

zuohuaijun 2 лет назад
Родитель
Сommit
0708e09c48

+ 1 - 1
Admin.NET/Admin.NET.Core/Job/EnumToDictJob.cs

@@ -145,7 +145,7 @@ public class EnumToDictJob : IJob
 
         var originColor = Console.ForegroundColor;
         Console.ForegroundColor = ConsoleColor.Green;
-        Console.WriteLine("【" + DateTime.Now + "】系统枚举转换字典");
+        Console.WriteLine($"【{DateTime.Now}】系统枚举转换字典");
         Console.ForegroundColor = originColor;
     }
 }

+ 2 - 2
Admin.NET/Admin.NET.Core/Job/LogJob.cs

@@ -37,10 +37,10 @@ public class LogJob : IJob
 
         var originColor = Console.ForegroundColor;
         Console.ForegroundColor = ConsoleColor.Yellow;
-        Console.WriteLine("【" + DateTime.Now + "】清理系统日志(30天前)");
+        Console.WriteLine($"【{DateTime.Now}】清理系统日志(30天前)");
         Console.ForegroundColor = originColor;
 
         // 自定义日志
-        _logger.LogInformation("清理系统日志");
+        _logger.LogInformation($"【{DateTime.Now}】清理系统日志...");
     }
 }

+ 2 - 2
Admin.NET/Admin.NET.Core/Job/OnlineUserJob.cs

@@ -33,13 +33,13 @@ public class OnlineUserJob : IJob
 
         var originColor = Console.ForegroundColor;
         Console.ForegroundColor = ConsoleColor.Red;
-        Console.WriteLine("【" + DateTime.Now + "】清空在线用户列表");
+        Console.WriteLine($"【{DateTime.Now}】清空在线用户列表");
         Console.ForegroundColor = originColor;
 
         // 缓存租户列表
         await serviceScope.ServiceProvider.GetRequiredService<SysTenantService>().CacheTenant();
 
         // 自定义日志
-        _logger.LogInformation("服务已重启...");
+        _logger.LogInformation($"【{DateTime.Now}】服务已重启...");
     }
 }