Skip to content

Commit

Permalink
feat: adding logger.Assert that doesn't require a message
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Mar 9, 2021
1 parent 76820e2 commit 8c213e3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Assets/Mirage/Runtime/LogFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ public static void Assert(this ILogger logger, bool condition, object message)
if (!condition)
logger.Log(LogType.Assert, message);
}
[System.Diagnostics.Conditional("UNITY_ASSERTIONS")]
public static void Assert(this ILogger logger, bool condition)
{
if (!condition)
logger.Log(LogType.Assert, "Failed Assertion");
}

public static void LogWarning(this ILogger logger, object message)
{
Expand Down

0 comments on commit 8c213e3

Please sign in to comment.