-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Better logging * Actually need this
- Loading branch information
Showing
7 changed files
with
117 additions
and
42 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System; | ||
using UnityEngine; | ||
|
||
namespace Whisper.Utils | ||
{ | ||
public enum LogLevel | ||
{ | ||
Verbose, | ||
Log, | ||
Warning, | ||
Error, | ||
} | ||
|
||
/// <summary> | ||
/// Wrapper for Unity logger that can be configured by log level. | ||
/// </summary> | ||
public static class LogUtils | ||
{ | ||
public static LogLevel Level = LogLevel.Verbose; | ||
|
||
public static void Exception(Exception msg) | ||
{ | ||
Debug.LogException(msg); | ||
} | ||
|
||
public static void Error(string msg) | ||
{ | ||
Debug.LogError(msg); | ||
} | ||
|
||
public static void Warning(string msg) | ||
{ | ||
if (Level > LogLevel.Warning) | ||
return; | ||
Debug.LogWarning(msg); | ||
} | ||
|
||
public static void Log(string msg) | ||
{ | ||
if (Level > LogLevel.Log) | ||
return; | ||
Debug.Log(msg); | ||
} | ||
|
||
public static void Verbose(string msg) | ||
{ | ||
if (Level > LogLevel.Verbose) | ||
return; | ||
Debug.Log(msg); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Oops, something went wrong.