Skip to content

Commit

Permalink
Fix UnityDebugLogger implementation (#143)
Browse files Browse the repository at this point in the history
## Description of Changes

Without explicit reference these result in

> error CS0119: 'UnityDebugLogger.Debug(string)' is a method, which is
not valid in the given context

## API

 - [ ] This is an API breaking change to the SDK

*If the API is breaking, please state below what will break*


## Requires SpacetimeDB PRs
*List any PRs here that are required for this SDK change to work*
  • Loading branch information
RReverser authored Oct 2, 2024
1 parent 8df6d15 commit 63e6f79
Showing 1 changed file with 14 additions and 29 deletions.
43 changes: 14 additions & 29 deletions src/UnityDebugLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,31 @@
*/
#if UNITY_5_3_OR_NEWER
using System;
using UnityEngine;

namespace SpacetimeDB
{
internal class UnityDebugLogger : ISpacetimeDBLogger
{
public void Debug(string message)
{
Debug.Log(message);
}
public void Debug(string message) =>
UnityEngine.Debug.Log(message);

public void Trace(string message)
{
Debug.Log(message);
}
public void Trace(string message) =>
UnityEngine.Debug.Log(message);

public void Info(string message)
{
Debug.Log(message);
}
public void Info(string message) =>
UnityEngine.Debug.Log(message);

public void Warn(string message)
{
Debug.LogWarning(message);
}
public void Warn(string message) =>
UnityEngine.Debug.LogWarning(message);

public void Error(string message)
{
Debug.LogError(message);
}
public void Error(string message) =>
UnityEngine.Debug.LogError(message);

public void Exception(string message)
{
Debug.LogError(message);
}
public void Exception(string message) =>
UnityEngine.Debug.LogError(message);

public void Exception(Exception e)
{
Debug.LogException(e);
}
public void Exception(Exception e) =>
UnityEngine.Debug.LogException(e);
}
}
#endif

0 comments on commit 63e6f79

Please sign in to comment.