diff --git a/csharp/App/SaliMax/src/Ess/Controller.cs b/csharp/App/SaliMax/src/Ess/Controller.cs index 64fe03b05..7d6601450 100644 --- a/csharp/App/SaliMax/src/Ess/Controller.cs +++ b/csharp/App/SaliMax/src/Ess/Controller.cs @@ -187,7 +187,7 @@ public static class Controller if (statusRecord.Battery.Eoc) { - "Batteries have reached EOC".Log(); + "Batteries have reached EOC".LogInfo(); config.LastEoc = UnixTime.Now; return false; } diff --git a/csharp/App/SaliMax/src/Logger.cs b/csharp/App/SaliMax/src/Logger.cs index 56414bf66..f89ecb653 100644 --- a/csharp/App/SaliMax/src/Logger.cs +++ b/csharp/App/SaliMax/src/Logger.cs @@ -10,11 +10,18 @@ public static class Logger private const Int32 MaxLogFileCount = 1000; // TODO: move to settings private const String LogFilePath = "LogDirectory/log.txt"; // TODO: move to settings + // ReSharper disable once InconsistentNaming private static readonly ILogger _logger = new CustomLogger(LogFilePath, MaxFileSizeBytes, MaxLogFileCount); - public static T Log(this T t) where T : notnull + public static T LogInfo(this T t) where T : notnull { - // _logger.LogInformation(t.ToString()); // TODO: check warning + _logger.LogInformation(t.ToString()); // TODO: check warning + return t; + } + + public static T LogDebug(this T t) where T : notnull + { + _logger.LogDebug(t.ToString()); // TODO: check warning return t; } } \ No newline at end of file diff --git a/csharp/App/SaliMax/src/SaliMaxRelays/RelaysDevice.cs b/csharp/App/SaliMax/src/SaliMaxRelays/RelaysDevice.cs index e58e5ac26..31afb815c 100644 --- a/csharp/App/SaliMax/src/SaliMaxRelays/RelaysDevice.cs +++ b/csharp/App/SaliMax/src/SaliMaxRelays/RelaysDevice.cs @@ -18,7 +18,7 @@ public class RelaysDevice } catch (Exception e) { - $"Failed to read from {nameof(RelaysDevice)}\n{e}".Log(); + $"Failed to read from {nameof(RelaysDevice)}\n{e}".LogInfo(); // TODO: log return null; @@ -33,7 +33,7 @@ public class RelaysDevice } catch (Exception e) { - $"Failed to write to {nameof(RelaysDevice)}\n{e}".Log(); + $"Failed to write to {nameof(RelaysDevice)}\n{e}".LogInfo(); } } }