Skip to content

Commit

Permalink
Simplifies ReflexLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavopsantos committed Aug 7, 2024
1 parent eb00568 commit 8217777
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
12 changes: 4 additions & 8 deletions Assets/Reflex/Logging/ReflexLogger.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using System;
using Reflex.Configuration;
using Reflex.Utilities;
using UnityEngine;

namespace Reflex.Logging
Expand All @@ -11,11 +10,13 @@ internal static class ReflexLogger

static ReflexLogger()
{
_logLevel = ResourcesUtilities.TryLoad<ReflexSettings>(nameof(ReflexSettings), out var reflexSettings)
var reflexSettings = Resources.Load<ReflexSettings>(nameof(ReflexSettings));

_logLevel = reflexSettings != null
? reflexSettings.LogLevel
: LogLevel.Info;

ReportLogLevel();
Log($"Reflex LogLevel set to {_logLevel}", LogLevel.Info);
}

public static void UpdateLogLevel(LogLevel logLevel)
Expand Down Expand Up @@ -43,10 +44,5 @@ public static void Log(object message, LogLevel logLevel, UnityEngine.Object con
default: throw new ArgumentOutOfRangeException(nameof(logLevel), logLevel, null);
}
}

private static void ReportLogLevel()
{
Log($"Reflex LogLevel set to {_logLevel}", LogLevel.Info);
}
}
}
13 changes: 0 additions & 13 deletions Assets/Reflex/Utilities/ResourcesUtilities.cs

This file was deleted.

3 changes: 0 additions & 3 deletions Assets/Reflex/Utilities/ResourcesUtilities.cs.meta

This file was deleted.

0 comments on commit 8217777

Please sign in to comment.