Add some logging and handle update error
All checks were successful
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 54s
All checks were successful
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 54s
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using LibreHardwareMonitor.Hardware;
|
using LibreHardwareMonitor.Hardware;
|
||||||
|
using Serilog;
|
||||||
|
|
||||||
namespace HardwareMonitorStatusWindow.Service;
|
namespace HardwareMonitorStatusWindow.Service;
|
||||||
|
|
||||||
@@ -12,6 +13,8 @@ public class HardwareMonitorService : IHardwareMonitorService
|
|||||||
|
|
||||||
static HardwareMonitorService()
|
static HardwareMonitorService()
|
||||||
{
|
{
|
||||||
|
Log.Information("Creating computer");
|
||||||
|
|
||||||
Computer = new Computer
|
Computer = new Computer
|
||||||
{
|
{
|
||||||
IsCpuEnabled = true,
|
IsCpuEnabled = true,
|
||||||
@@ -25,6 +28,8 @@ public class HardwareMonitorService : IHardwareMonitorService
|
|||||||
IsPsuEnabled = true
|
IsPsuEnabled = true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Log.Information("Opening computer");
|
||||||
|
|
||||||
Computer.Open();
|
Computer.Open();
|
||||||
|
|
||||||
HardwareUpdateVisitor = new HardwareUpdateVisitor();
|
HardwareUpdateVisitor = new HardwareUpdateVisitor();
|
||||||
@@ -32,8 +37,12 @@ public class HardwareMonitorService : IHardwareMonitorService
|
|||||||
|
|
||||||
public IEnumerable<Hardware> GetHardware()
|
public IEnumerable<Hardware> GetHardware()
|
||||||
{
|
{
|
||||||
|
Log.Information("Updating computer");
|
||||||
|
|
||||||
Computer.Accept(HardwareUpdateVisitor);
|
Computer.Accept(HardwareUpdateVisitor);
|
||||||
|
|
||||||
|
Log.Information("Creating hardware entries");
|
||||||
|
|
||||||
var hardwareEntries = Computer.Hardware.Select(Hardware.Create);
|
var hardwareEntries = Computer.Hardware.Select(Hardware.Create);
|
||||||
|
|
||||||
return hardwareEntries;
|
return hardwareEntries;
|
||||||
|
|||||||
@@ -120,6 +120,8 @@ internal class WindowSource : IWindowSource, IDisposable
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
Log.Error(e, nameof(UpdateApp));
|
Log.Error(e, nameof(UpdateApp));
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user