Skip to content

Commit

Permalink
Fix CS8602 warning in MessageSlicer (#689)
Browse files Browse the repository at this point in the history
  • Loading branch information
IhateTrains authored Nov 21, 2024
1 parent 1a8e09a commit bd77373
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build_frontend/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ then

if [ "$RUNNER_OS" = "macOS" ]
then
brew uninstall python-packaging
brew uninstall --ignore-dependencies python-packaging
fi

PIP_BREAK_SYSTEM_PACKAGES=1 pip3 install -r requirements.txt
Expand Down
9 changes: 8 additions & 1 deletion Fronter.NET/Services/MessageSlicer.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using Fronter.Models;
using log4net;
using log4net.Core;
using System;
using System.Text.RegularExpressions;

namespace Fronter.Services;

public static partial class MessageSlicer {
private static readonly ILog logger = LogManager.GetLogger("Frontend");
private static readonly Regex dateTimeRegex = GetDateTimeRegex();

public static LogLine SliceMessage(string message) {
Expand Down Expand Up @@ -38,10 +40,15 @@ public static LogLine SliceMessage(string message) {
}

private static Level GetLogLevel(string levelStr) {
if (levelStr == "WARNING") {
if (levelStr.Equals("WARNING", StringComparison.OrdinalIgnoreCase)) {
levelStr = "WARN";
}
var level = LogManager.GetRepository().LevelMap[levelStr];
if (level == null) {
logger.Warn($"Unknown log level: {levelStr}");
level = Level.Debug;
}

return level;
}

Expand Down

0 comments on commit bd77373

Please sign in to comment.