Skip to content

Commit

Permalink
Update todo comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
elle-j committed Jun 28, 2024
1 parent ed1a22f commit e289d2e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Realm/Realm/Logging/Logger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,14 @@ public abstract class Logger
/// </returns>
public static Logger Function(Action<LogLevel, LogCategory, string> logFunction) => new FunctionLogger(logFunction);

// TODO(lj): Deprecate
/// <summary>
/// Gets or sets the verbosity of log messages.
/// </summary>
/// <value>The log level for Realm-originating messages.</value>
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);
Expand All @@ -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()`?
/// <summary>
/// Gets or sets a custom <see cref="Logger"/> implementation that will be used by
/// Realm whenever information must be logged.
Expand All @@ -147,6 +144,7 @@ protected Logger()

internal static void LogDefault(LogLevel level, LogCategory category, string message) => Default?.Log(level, category, message);

// TODO(lj): Deprecate
/// <summary>
/// Log a message at the supplied level.
/// </summary>
Expand All @@ -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;
}
Expand Down

0 comments on commit e289d2e

Please sign in to comment.