Created
July 23, 2018 06:15
-
-
Save Lachee/8e98934b4fd17094aea29d224e05418a to your computer and use it in GitHub Desktop.
A logger for Discord RPC C# for use within the Unity3D engine.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DebugLogger : DiscordRPC.Logging.ILogger | |
{ | |
public LogLevel Level { get; set; } | |
public void Info(string message, params object[] args) | |
{ | |
if (Level != LogLevel.Info) return; | |
Debug.Log("[DRPC] " + string.Format(message, args)); | |
} | |
public void Warning(string message, params object[] args) | |
{ | |
if (Level != LogLevel.Info && Level != LogLevel.Warning) return; | |
Debug.LogWarning("[DRPC] " + string.Format(message, args)); | |
} | |
public void Error(string message, params object[] args) | |
{ | |
if (Level != LogLevel.Info && Level != LogLevel.Warning && Level != LogLevel.Error) return; | |
Debug.LogError("[DRPC] " + string.Format(message, args)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you forgot those two lines :
And the class need to be
public
to be usedSo we have this :