ntminer 6 years ago
parent
commit
931e3596cb

+ 1 - 1
src/AppModels/AppStatic.cs

@@ -66,7 +66,7 @@ namespace NTMiner {
                                         callback?.Invoke();
                                     }
                                     else {
-                                        VirtualRoot.LocalError(nameof(AppStatic), message, toConsole: true);
+                                        VirtualRoot.ThisLocalError(nameof(AppStatic), message, toConsole: true);
                                         callback?.Invoke();
                                     }
                                 }

+ 3 - 3
src/AppModels/Vms/KernelProfileViewModel.cs

@@ -200,7 +200,7 @@ namespace NTMiner.Vms {
                     UIThread.Execute(() => {
                         bool isSuccess = !e.Cancelled && e.Error == null;
                         if (isSuccess) {
-                            VirtualRoot.LocalInfo(nameof(KernelProfileViewModel), package + "下载成功", toConsole: true);
+                            VirtualRoot.ThisLocalInfo(nameof(KernelProfileViewModel), package + "下载成功", toConsole: true);
                         }
                         string message = "下载成功";
                         if (e.Error != null) {
@@ -219,10 +219,10 @@ namespace NTMiner.Vms {
                     if (string.IsNullOrEmpty(packageUrl)) {
                         string msg = $"未获取到{package}内核包下载地址";
                         downloadComplete?.Invoke(false, msg, saveFileFullName);
-                        VirtualRoot.LocalError(nameof(KernelProfileViewModel), msg, toConsole: true);
+                        VirtualRoot.ThisLocalError(nameof(KernelProfileViewModel), msg, toConsole: true);
                     }
                     else {
-                        VirtualRoot.LocalInfo(nameof(KernelProfileViewModel), "下载:" + package, toConsole: true);
+                        VirtualRoot.ThisLocalInfo(nameof(KernelProfileViewModel), "下载:" + package, toConsole: true);
                         webClient.DownloadFileAsync(new Uri(packageUrl), saveFileFullName);
                     }
                 });

+ 3 - 3
src/AppModels/Vms/StartStopMineButtonViewModel.cs

@@ -16,13 +16,13 @@ namespace NTMiner.Vms {
                 Write.Stopwatch.Start();
 #endif
             this.StartMine = new DelegateCommand(() => {
-                VirtualRoot.LocalInfo(nameof(StartStopMineButtonViewModel), $"手动开始挖矿", toConsole: true);
+                VirtualRoot.ThisLocalInfo(nameof(StartStopMineButtonViewModel), $"手动开始挖矿", toConsole: true);
                 this.MinerProfile.IsMining = true;
                 NTMinerRoot.Instance.StartMine();
                 BtnStopText = "正在挖矿";
             });
             this.StopMine = new DelegateCommand(() => {
-                VirtualRoot.LocalInfo(nameof(StartStopMineButtonViewModel), $"手动停止挖矿", toConsole: true);
+                VirtualRoot.ThisLocalInfo(nameof(StartStopMineButtonViewModel), $"手动停止挖矿", toConsole: true);
                 if (!NTMinerRoot.Instance.IsMining) {
                     this.MinerProfile.IsMining = false;
                 }
@@ -59,7 +59,7 @@ namespace NTMiner.Vms {
                         if (!NTMinerRoot.IsAutoStartCanceled) {
                             BtnStopText = "正在挖矿";
                             MinerProfile.IsMining = true;
-                            VirtualRoot.LocalInfo(nameof(StartStopMineButtonViewModel), $"自动开始挖矿", toConsole: true);
+                            VirtualRoot.ThisLocalInfo(nameof(StartStopMineButtonViewModel), $"自动开始挖矿", toConsole: true);
                             NTMinerRoot.Instance.StartMine();
                         }
                     }

+ 2 - 2
src/AppViews0/MainWindow.xaml.cs

@@ -362,7 +362,7 @@ namespace NTMiner.Views {
                         if (Vm.MinerProfile.HighTemperatureCount >= Vm.MinerProfile.CpuGETemperatureSeconds) {
                             Vm.MinerProfile.HighTemperatureCount = 0;
                             NTMinerRoot.Instance.StopMineAsync(StopMineReason.HighCpuTemperature);
-                            VirtualRoot.LocalInfo(nameof(MainWindow), $"自动停止挖矿,因为 CPU 温度连续{Vm.MinerProfile.CpuGETemperatureSeconds}秒不低于{Vm.MinerProfile.CpuStopTemperature}℃", toConsole: true);
+                            VirtualRoot.ThisLocalInfo(nameof(MainWindow), $"自动停止挖矿,因为 CPU 温度连续{Vm.MinerProfile.CpuGETemperatureSeconds}秒不低于{Vm.MinerProfile.CpuStopTemperature}℃", toConsole: true);
                         }
                     }
                     else {
@@ -376,7 +376,7 @@ namespace NTMiner.Views {
                             }
                             if (Vm.MinerProfile.LowTemperatureCount >= Vm.MinerProfile.CpuLETemperatureSeconds) {
                                 Vm.MinerProfile.LowTemperatureCount = 0;
-                                VirtualRoot.LocalInfo(nameof(MainWindow), $"自动开始挖矿,因为 CPU 温度连续{Vm.MinerProfile.CpuLETemperatureSeconds}秒不高于{Vm.MinerProfile.CpuStartTemperature}℃", toConsole: true);
+                                VirtualRoot.ThisLocalInfo(nameof(MainWindow), $"自动开始挖矿,因为 CPU 温度连续{Vm.MinerProfile.CpuLETemperatureSeconds}秒不高于{Vm.MinerProfile.CpuStartTemperature}℃", toConsole: true);
                                 NTMinerRoot.Instance.StartMine();
                             }
                         }

+ 8 - 8
src/MinerClient/App.xaml.cs

@@ -91,13 +91,13 @@ namespace NTMiner {
                     NTMinerRoot.Instance.Init(() => {
                         _appViewFactory.Link();
                         if (VirtualRoot.IsLTWin10) {
-                            VirtualRoot.LocalWarn(nameof(App), AppStatic.LowWinMessage, toConsole: true);
+                            VirtualRoot.ThisLocalWarn(nameof(App), AppStatic.LowWinMessage, toConsole: true);
                         }
                         if (NTMinerRoot.Instance.GpuSet.Count == 0) {
-                            VirtualRoot.LocalError(nameof(App), "没有矿卡或矿卡未驱动。", toConsole: true);
+                            VirtualRoot.ThisLocalError(nameof(App), "没有矿卡或矿卡未驱动。", toConsole: true);
                         }
                         if (NTMinerRoot.Instance.ServerContext.CoinSet.Count == 0) {
-                            VirtualRoot.LocalError(nameof(App), "访问阿里云失败,请尝试更换本机dns解决此问题。", toConsole: true);
+                            VirtualRoot.ThisLocalError(nameof(App), "访问阿里云失败,请尝试更换本机dns解决此问题。", toConsole: true);
                         }
                         UIThread.Execute(() => {
                             if (NTMinerRoot.Instance.MinerProfile.IsNoUi && NTMinerRoot.Instance.MinerProfile.IsAutoStart) {
@@ -174,7 +174,7 @@ namespace NTMiner {
         private void Link() {
             VirtualRoot.BuildCmdPath<CloseNTMinerCommand>(action: message => {
                 // 不能推迟这个日志记录的时机,因为推迟会有windows异常日志
-                VirtualRoot.LocalInfo(nameof(NTMinerRoot), $"退出{VirtualRoot.AppName}");
+                VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), $"退出{VirtualRoot.AppName}");
                 UIThread.Execute(() => {
                     try {
                         Shutdown();
@@ -265,10 +265,10 @@ namespace NTMiner {
             SwitchRadeonGpu.SwitchRadeonGpu.Run(on, (isSuccess, e) => {
                 if (isSuccess) {
                     if (on) {
-                        VirtualRoot.LocalInfo(nameof(App), "开启A卡计算模式成功", OutEnum.Success);
+                        VirtualRoot.ThisLocalInfo(nameof(App), "开启A卡计算模式成功", OutEnum.Success);
                     }
                     else {
-                        VirtualRoot.LocalInfo(nameof(App), "关闭A卡计算模式成功", OutEnum.Success);
+                        VirtualRoot.ThisLocalInfo(nameof(App), "关闭A卡计算模式成功", OutEnum.Success);
                     }
                 }
                 else if (e != null) {
@@ -276,10 +276,10 @@ namespace NTMiner {
                 }
                 else {
                     if (on) {
-                        VirtualRoot.LocalError(nameof(App), "开启A卡计算模式失败", OutEnum.Warn);
+                        VirtualRoot.ThisLocalError(nameof(App), "开启A卡计算模式失败", OutEnum.Warn);
                     }
                     else {
-                        VirtualRoot.LocalError(nameof(App), "关闭A卡计算模式失败", OutEnum.Warn);
+                        VirtualRoot.ThisLocalError(nameof(App), "关闭A卡计算模式失败", OutEnum.Warn);
                     }
                 }
             });

+ 4 - 4
src/MinerClient/Windows/WindowsUtil.cs

@@ -18,11 +18,11 @@ namespace NTMiner.Windows {
                     string fileFullName = Path.Combine(MainAssemblyInfo.TempDirFullName, name);
                     assembly.ExtractManifestResource(type, name, fileFullName);
                     Cmd.RunClose(fileFullName, string.Empty, waitForExit: true);
-                    VirtualRoot.LocalInfo(nameof(WindowsUtil), "禁用windows系统更新成功", OutEnum.Success);
+                    VirtualRoot.ThisLocalInfo(nameof(WindowsUtil), "禁用windows系统更新成功", OutEnum.Success);
                 });
             }
             catch (Exception e) {
-                VirtualRoot.LocalError(nameof(WindowsUtil), "禁用windows系统更新失败", OutEnum.Warn);
+                VirtualRoot.ThisLocalError(nameof(WindowsUtil), "禁用windows系统更新失败", OutEnum.Warn);
                 Logger.ErrorDebugLine(e);
             }
         }
@@ -36,12 +36,12 @@ namespace NTMiner.Windows {
                     string fileFullName = Path.Combine(MainAssemblyInfo.TempDirFullName, name);
                     assembly.ExtractManifestResource(type, name, fileFullName);
                     Cmd.RunClose("regedit", $"/s \"{fileFullName}\"", waitForExit: true);
-                    VirtualRoot.LocalInfo(nameof(WindowsUtil), "优化Windows成功", OutEnum.Success);
+                    VirtualRoot.ThisLocalInfo(nameof(WindowsUtil), "优化Windows成功", OutEnum.Success);
                 });
             }
             catch (Exception e) {
                 Logger.ErrorDebugLine(e);
-                VirtualRoot.LocalError(nameof(WindowsUtil), "优化Windows失败", OutEnum.Warn);
+                VirtualRoot.ThisLocalError(nameof(WindowsUtil), "优化Windows失败", OutEnum.Warn);
             }
         }
     }

+ 5 - 5
src/MinerClientSelfHost/MinerClientController.cs

@@ -27,7 +27,7 @@ namespace NTMiner {
                 return ResponseBase.InvalidInput("参数错误");
             }
             try {
-                VirtualRoot.LocalInfo(nameof(MinerClientController), $"退出挖矿端");
+                VirtualRoot.ThisLocalInfo(nameof(MinerClientController), $"退出挖矿端");
                 TimeSpan.FromMilliseconds(100).Delay().ContinueWith((t) => {
                     VirtualRoot.Execute(new CloseNTMinerCommand());
                 });
@@ -45,7 +45,7 @@ namespace NTMiner {
                 return ResponseBase.InvalidInput("参数错误");
             }
             try {
-                VirtualRoot.LocalInfo(nameof(MinerClientController), $"开始挖矿", toConsole: true);
+                VirtualRoot.ThisLocalInfo(nameof(MinerClientController), $"开始挖矿", toConsole: true);
                 NTMinerRoot.Instance.RestartMine(isWork: request.WorkId != Guid.Empty);
                 return ResponseBase.Ok();
             }
@@ -61,7 +61,7 @@ namespace NTMiner {
                 return ResponseBase.InvalidInput("参数错误");
             }
             try {
-                VirtualRoot.LocalInfo(nameof(MinerClientController), $"停止挖矿", toConsole: true);
+                VirtualRoot.ThisLocalInfo(nameof(MinerClientController), $"停止挖矿", toConsole: true);
                 NTMinerRoot.Instance.StopMineAsync(StopMineReason.RPCUserAction);
                 return ResponseBase.Ok();
             }
@@ -77,7 +77,7 @@ namespace NTMiner {
                 return ResponseBase.InvalidInput("参数错误");
             }
             try {
-                VirtualRoot.LocalInfo(nameof(MinerClientController), $"设置挖矿参数");
+                VirtualRoot.ThisLocalInfo(nameof(MinerClientController), $"设置挖矿参数");
                 NTMinerRoot.Instance.MinerProfile.SetMinerProfileProperty(request.PropertyName, request.Value);
                 return ResponseBase.Ok();
             }
@@ -106,7 +106,7 @@ namespace NTMiner {
 
         [HttpPost]
         public void OverClock() {
-            VirtualRoot.LocalInfo(nameof(MinerClientController), $"刷新超频", toConsole: true);
+            VirtualRoot.ThisLocalInfo(nameof(MinerClientController), $"刷新超频", toConsole: true);
             NTMinerRoot.Instance.GpuProfileSet.Refresh();
         }
     }

+ 1 - 1
src/MinerStudio/App.xaml.cs

@@ -70,7 +70,7 @@ namespace NTMiner {
                 });
                 VirtualRoot.BuildCmdPath<CloseNTMinerCommand>(action: message => {
                     // 不能推迟这个日志记录的时机,因为推迟会有windows异常日志
-                    VirtualRoot.LocalInfo(nameof(NTMinerRoot), $"退出{VirtualRoot.AppName}");
+                    VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), $"退出{VirtualRoot.AppName}");
                     UIThread.Execute(() => {
                         try {
                             Shutdown();

+ 1 - 1
src/MinerStudio/NTMinerServices/NTMinerServicesUtil.cs

@@ -33,7 +33,7 @@ namespace NTMiner.NTMinerServices {
                     }
                     catch (Exception e) {
                         Logger.ErrorDebugLine(e);
-                        VirtualRoot.LocalError(nameof(NTMinerServicesUtil), "启动失败,请重试,如果问题一直持续请联系开发者解决问题", toConsole: true);
+                        VirtualRoot.ThisLocalError(nameof(NTMinerServicesUtil), "启动失败,请重试,如果问题一直持续请联系开发者解决问题", toConsole: true);
                     }
                 });
             }

+ 1 - 1
src/MinerStudioSelfHost/MinerStudioController.cs

@@ -25,7 +25,7 @@ namespace NTMiner {
                 return ResponseBase.InvalidInput("参数错误");
             }
             try {
-                VirtualRoot.LocalInfo(nameof(MinerStudioController), $"退出群控端");
+                VirtualRoot.ThisLocalInfo(nameof(MinerStudioController), $"退出群控端");
                 TimeSpan.FromMilliseconds(100).Delay().ContinueWith(t => {
                     VirtualRoot.Execute(new CloseNTMinerCommand());
                 });

+ 14 - 14
src/NTMinerClient/NTMinerRoot.cs

@@ -73,10 +73,10 @@ namespace NTMiner {
                             }
                             else {
                                 if (!File.Exists(SpecialPath.ServerJsonFileFullName)) {
-                                    VirtualRoot.LocalError(nameof(NTMinerRoot), "配置文件下载失败,这是第一次运行开源矿工,配置文件至少需要成功下载一次,请检查网络是否可用", OutEnum.Warn);
+                                    VirtualRoot.ThisLocalError(nameof(NTMinerRoot), "配置文件下载失败,这是第一次运行开源矿工,配置文件至少需要成功下载一次,请检查网络是否可用", OutEnum.Warn);
                                 }
                                 else {
-                                    VirtualRoot.LocalWarn(nameof(NTMinerRoot), "配置文件下载失败,使用最近一次成功下载的配置文件", OutEnum.Warn);
+                                    VirtualRoot.ThisLocalWarn(nameof(NTMinerRoot), "配置文件下载失败,使用最近一次成功下载的配置文件", OutEnum.Warn);
                                 }
                             }
                             DoInit(isWork, callback);
@@ -89,7 +89,7 @@ namespace NTMiner {
                         #endregion
                     }
                 }
-                VirtualRoot.LocalInfo(nameof(NTMinerRoot), $"启动{VirtualRoot.AppName}");
+                VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), $"启动{VirtualRoot.AppName}");
             });
         }
 
@@ -117,7 +117,7 @@ namespace NTMiner {
                         ReInitServerJson();
                         // 作业模式下界面是禁用的,所以这里的初始化isWork必然是false
                         ContextReInit(isWork: VirtualRoot.IsMinerStudio);
-                        VirtualRoot.LocalInfo(nameof(NTMinerRoot), $"刷新server.json配置", toConsole: true);
+                        VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), $"刷新server.json配置", toConsole: true);
                     });
                 }
                 else {
@@ -215,11 +215,11 @@ namespace NTMiner {
             VirtualRoot.BuildCmdPath<RegCmdHereCommand>(action: message => {
                 try {
                     Windows.Cmd.RegCmdHere(); 
-                    VirtualRoot.LocalInfo(nameof(NTMinerRoot), "windows右键命令行添加成功", OutEnum.Success);
+                    VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), "windows右键命令行添加成功", OutEnum.Success);
                 }
                 catch (Exception e) {
                     Logger.ErrorDebugLine(e);
-                    VirtualRoot.LocalError(nameof(NTMinerRoot), "windows右键命令行添加失败", OutEnum.Warn);
+                    VirtualRoot.ThisLocalError(nameof(NTMinerRoot), "windows右键命令行添加失败", OutEnum.Warn);
                 }
             });
             VirtualRoot.BuildEventPath<Per1MinuteEvent>("每1分钟阻止系统休眠", LogEnum.None,
@@ -245,7 +245,7 @@ namespace NTMiner {
                     try {
                         if (MinerProfile.IsPeriodicRestartComputer) {
                             if ((DateTime.Now - this.CreatedOn).TotalMinutes > 60 * MinerProfile.PeriodicRestartComputerHours + MinerProfile.PeriodicRestartComputerMinutes) {
-                                VirtualRoot.LocalInfo(nameof(NTMinerRoot), $"每运行{MinerProfile.PeriodicRestartKernelHours}小时{MinerProfile.PeriodicRestartComputerMinutes}分钟重启电脑", toConsole: true);
+                                VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), $"每运行{MinerProfile.PeriodicRestartKernelHours}小时{MinerProfile.PeriodicRestartComputerMinutes}分钟重启电脑", toConsole: true);
                                 Windows.Power.Restart(60);
                                 VirtualRoot.Execute(new CloseNTMinerCommand());
                                 return;// 退出
@@ -261,7 +261,7 @@ namespace NTMiner {
                     try {
                         if (IsMining && MinerProfile.IsPeriodicRestartKernel) {
                             if ((DateTime.Now - LockedMineContext.CreatedOn).TotalMinutes > 60 * MinerProfile.PeriodicRestartKernelHours + MinerProfile.PeriodicRestartKernelMinutes) {
-                                VirtualRoot.LocalInfo(nameof(NTMinerRoot), $"每运行{MinerProfile.PeriodicRestartKernelHours}小时{MinerProfile.PeriodicRestartKernelMinutes}分钟重启内核", toConsole: true);
+                                VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), $"每运行{MinerProfile.PeriodicRestartKernelHours}小时{MinerProfile.PeriodicRestartKernelMinutes}分钟重启内核", toConsole: true);
                                 RestartMine();
                                 return;// 退出
                             }
@@ -291,14 +291,14 @@ namespace NTMiner {
                                         if (!MinerProfile.IsAutoBoot || !MinerProfile.IsAutoStart) {
                                             VirtualRoot.Execute(new SetAutoStartCommand(true, true));
                                         }
-                                        VirtualRoot.LocalInfo(nameof(NTMinerRoot), $"{MinerProfile.NoShareRestartComputerMinutes}分钟无份额重启电脑", toConsole: true);
+                                        VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), $"{MinerProfile.NoShareRestartComputerMinutes}分钟无份额重启电脑", toConsole: true);
                                         Windows.Power.Restart(60);
                                         VirtualRoot.Execute(new CloseNTMinerCommand());
                                         return;// 退出
                                     }
                                     // 产生过份额或者已经两倍重启内核时间了
                                     if (restartKernel && (totalShare > 0 || (DateTime.Now - shareOn).TotalMinutes > 2 * MinerProfile.NoShareRestartKernelMinutes)) {
-                                        VirtualRoot.LocalInfo(nameof(NTMinerRoot), $"{MinerProfile.NoShareRestartKernelMinutes}分钟无份额重启内核", toConsole: true);
+                                        VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), $"{MinerProfile.NoShareRestartKernelMinutes}分钟无份额重启内核", toConsole: true);
                                         RestartMine();
                                         return;// 退出
                                     }
@@ -360,7 +360,7 @@ namespace NTMiner {
                 }
                 var mineContext = _lockedMineContext;
                 _lockedMineContext = null;
-                VirtualRoot.LocalInfo(nameof(NTMinerRoot), "挖矿停止", toConsole: true);
+                VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), "挖矿停止", toConsole: true);
                 VirtualRoot.RaiseEvent(new MineStopedEvent(mineContext, stopReason));
             }
             catch (Exception e) {
@@ -491,7 +491,7 @@ namespace NTMiner {
                 }
                 string packageZipFileFullName = Path.Combine(SpecialPath.PackagesDirFullName, kernel.Package);
                 if (!File.Exists(packageZipFileFullName)) {
-                    VirtualRoot.LocalInfo(nameof(NTMinerRoot), kernel.GetFullName() + "本地内核包不存在,开始自动下载", toConsole: true);
+                    VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), kernel.GetFullName() + "本地内核包不存在,开始自动下载", toConsole: true);
                     VirtualRoot.Execute(new ShowKernelDownloaderCommand(kernel.GetId(), downloadComplete: (isSuccess, message) => {
                         if (isSuccess) {
                             StartMine(isRestart);
@@ -511,9 +511,9 @@ namespace NTMiner {
                     }
                     _lockedMineContext.IsRestart = isRestart;
                     MinerProcess.CreateProcessAsync(_lockedMineContext);
-                    VirtualRoot.LocalInfo(nameof(NTMinerRoot), "开始挖矿", toConsole: true);
+                    VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), "开始挖矿", toConsole: true);
                     if (_lockedMineContext.UseDevices.Length != GpuSet.Count) {
-                        VirtualRoot.LocalWarn(nameof(NTMinerRoot), "未启用全部显卡挖矿", toConsole: true);
+                        VirtualRoot.ThisLocalWarn(nameof(NTMinerRoot), "未启用全部显卡挖矿", toConsole: true);
                     }
                 }
             }

+ 3 - 3
src/NTMinerClient/NTMinerRoot.partials.MinerProcess.cs

@@ -142,9 +142,9 @@ namespace NTMiner {
                                 Process[] processes = Process.GetProcessesByName(processName);
                                 if (processes.Length == 0) {
                                     mineContext.AutoRestartKernelCount += 1;
-                                    VirtualRoot.LocalWarn(nameof(NTMinerRoot), processName + $"挖矿内核进程消失", toConsole: true);
+                                    VirtualRoot.ThisLocalWarn(nameof(NTMinerRoot), processName + $"挖矿内核进程消失", toConsole: true);
                                     if (Instance.MinerProfile.IsAutoRestartKernel && mineContext.AutoRestartKernelCount <= Instance.MinerProfile.AutoRestartKernelTimes) {
-                                        VirtualRoot.LocalInfo(nameof(NTMinerRoot), $"尝试第{mineContext.AutoRestartKernelCount}次重启,共{Instance.MinerProfile.AutoRestartKernelTimes}次", toConsole: true);
+                                        VirtualRoot.ThisLocalInfo(nameof(NTMinerRoot), $"尝试第{mineContext.AutoRestartKernelCount}次重启,共{Instance.MinerProfile.AutoRestartKernelTimes}次", toConsole: true);
                                         Instance.RestartMine();
                                         Instance.LockedMineContext.AutoRestartKernelCount = mineContext.AutoRestartKernelCount;
                                     }
@@ -462,7 +462,7 @@ namespace NTMiner {
                                                     if (!string.IsNullOrEmpty(keyword.Description)) {
                                                         content += $"大意:{keyword.Description}";
                                                     }
-                                                    VirtualRoot.LocalMessage(nameof(MinerProcess), messageType, content, OutEnum.None, toConsole: false);
+                                                    VirtualRoot.LocalMessage(LocalMessageChannel.Kernel, nameof(MinerProcess), messageType, content, OutEnum.None, toConsole: false);
                                                 }
                                             }
                                         }

+ 1 - 1
src/NTMinerWpf/Views/NotiCenterWindow.xaml.cs

@@ -69,7 +69,7 @@ namespace NTMiner.Views {
                         return false;
                     }
                     else {
-                        VirtualRoot.LocalInfo(nameof(NotiCenterWindow), $"热键Ctrl + Alt + {key.ToString()} 设置成功", OutEnum.Success);
+                        VirtualRoot.ThisLocalInfo(nameof(NotiCenterWindow), $"热键Ctrl + Alt + {key.ToString()} 设置成功", OutEnum.Success);
                         return true;
                     }
                 };

+ 4 - 4
src/NTMinerlib/Ip/Impl/LocalIpSet.cs

@@ -89,12 +89,12 @@ namespace NTMiner.Ip.Impl {
                 Refresh();
                 var localIps = _localIps;
                 if (old.Count != localIps.Count) {
-                    VirtualRoot.LocalWarn(nameof(LocalIpSet), "网络接口的 IP 地址发生了更改", toConsole: true);
+                    VirtualRoot.ThisLocalWarn(nameof(LocalIpSet), "网络接口的 IP 地址发生了更改", toConsole: true);
                 }
                 else {
                     for (int i = 0; i < old.Count; i++) {
                         if (old[i] != localIps[i]) {
-                            VirtualRoot.LocalWarn(nameof(LocalIpSet), "网络接口的 IP 地址发生了更改", toConsole: true);
+                            VirtualRoot.ThisLocalWarn(nameof(LocalIpSet), "网络接口的 IP 地址发生了更改", toConsole: true);
                             break;
                         }
                     }
@@ -102,10 +102,10 @@ namespace NTMiner.Ip.Impl {
             };
             NetworkChange.NetworkAvailabilityChanged += (object sender, NetworkAvailabilityEventArgs e) => {
                 if (e.IsAvailable) {
-                    VirtualRoot.LocalInfo(nameof(LocalIpSet), $"网络可用", toConsole: true);
+                    VirtualRoot.ThisLocalInfo(nameof(LocalIpSet), $"网络可用", toConsole: true);
                 }
                 else {
-                    VirtualRoot.LocalWarn(nameof(LocalIpSet), $"网络不可用", toConsole: true);
+                    VirtualRoot.ThisLocalWarn(nameof(LocalIpSet), $"网络不可用", toConsole: true);
                 }
             };
             VirtualRoot.BuildCmdPath<SetLocalIpCommand>(action: message => {

+ 8 - 8
src/NTMinerlib/VirtualRoot.cs

@@ -350,19 +350,19 @@ namespace NTMiner {
         #endregion
 
         #region LocalMessage
-        public static void LocalInfo(string provider, string content, OutEnum outEnum = OutEnum.None, bool toConsole = false) {
-            LocalMessage(provider, LocalMessageType.Info, content, outEnum: outEnum, toConsole: toConsole);
+        public static void ThisLocalInfo(string provider, string content, OutEnum outEnum = OutEnum.None, bool toConsole = false) {
+            LocalMessage(LocalMessageChannel.This, provider, LocalMessageType.Info, content, outEnum: outEnum, toConsole: toConsole);
         }
 
-        public static void LocalWarn(string provider, string content, OutEnum outEnum = OutEnum.None, bool toConsole = false) {
-            LocalMessage(provider, LocalMessageType.Warn, content, outEnum: outEnum, toConsole: toConsole);
+        public static void ThisLocalWarn(string provider, string content, OutEnum outEnum = OutEnum.None, bool toConsole = false) {
+            LocalMessage(LocalMessageChannel.This, provider, LocalMessageType.Warn, content, outEnum: outEnum, toConsole: toConsole);
         }
 
-        public static void LocalError(string provider, string content, OutEnum outEnum = OutEnum.None, bool toConsole = false) {
-            LocalMessage(provider, LocalMessageType.Error, content, outEnum: outEnum, toConsole: toConsole);
+        public static void ThisLocalError(string provider, string content, OutEnum outEnum = OutEnum.None, bool toConsole = false) {
+            LocalMessage(LocalMessageChannel.This, provider, LocalMessageType.Error, content, outEnum: outEnum, toConsole: toConsole);
         }
 
-        public static void LocalMessage(string provider, LocalMessageType messageType, string content, OutEnum outEnum, bool toConsole) {
+        public static void LocalMessage(LocalMessageChannel channel, string provider, LocalMessageType messageType, string content, OutEnum outEnum, bool toConsole) {
             switch (outEnum) {
                 case OutEnum.None:
                     break;
@@ -398,7 +398,7 @@ namespace NTMiner {
             }
             Execute(new AddLocalMessageCommand(new LocalMessageData {
                 Id = Guid.NewGuid(),
-                Channel = LocalMessageChannel.This.GetName(),
+                Channel = channel.GetName(),
                 Provider = provider,
                 MessageType = messageType.GetName(),
                 Content = content,

+ 1 - 1
src/UnitTests/LocalMessageTests.cs

@@ -12,7 +12,7 @@ namespace UnitTests {
             Assert.IsTrue(times > NTKeyword.LocalMessageSetCapacity);
             string content = "this is a test";
             for (int i = 0; i < times; i++) {
-                VirtualRoot.LocalInfo(nameof(LocalMessageTests), content);
+                VirtualRoot.ThisLocalInfo(nameof(LocalMessageTests), content);
             }
             Assert.IsTrue(VirtualRoot.LocalMessages.Count() == NTKeyword.LocalMessageSetCapacity);
         }