diff --git a/Realm/Realm/Logging/Logger.cs b/Realm/Realm/Logging/Logger.cs index 3acc251f16..a8c87c25b0 100644 --- a/Realm/Realm/Logging/Logger.cs +++ b/Realm/Realm/Logging/Logger.cs @@ -93,15 +93,14 @@ public abstract class Logger /// public static Logger Function(Action logFunction) => new FunctionLogger(logFunction); + // TODO(lj): Deprecate /// /// Gets or sets the verbosity of log messages. /// /// The log level for Realm-originating messages. public static LogLevel LogLevel { - // TODO(lj): Do we want to deprecate the getter as well? get => GetLogLevel(); - // TODO(lj): Deprecate and refer to `SetLogLevel`. set { SetLogLevel(value); @@ -120,8 +119,6 @@ public static void SetLogLevel(LogLevel level, LogCategory? category = null) SharedRealmHandle.SetLogLevel(level, category); } - // TODO(lj): Would it make sense to also deprecate the Default setter - // and provide e.g. `SetDefaultLogger()`? /// /// Gets or sets a custom implementation that will be used by /// Realm whenever information must be logged. @@ -147,6 +144,7 @@ protected Logger() internal static void LogDefault(LogLevel level, LogCategory category, string message) => Default?.Log(level, category, message); + // TODO(lj): Deprecate /// /// Log a message at the supplied level. /// @@ -158,9 +156,10 @@ public void Log(LogLevel level, string message) Log(level, _defaultLogCategory, message); } + // TODO(lj): Use category as optional 3rd param. public void Log(LogLevel level, LogCategory category, string message) { - if (level < LogLevel) + if (level < GetLogLevel(category)) { return; }