-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
347 additions
and
110 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
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
8 changes: 8 additions & 0 deletions
8
src/Packages/Passport/Runtime/Scripts/Private/Core/Logging.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
...ages/Passport/Runtime/Scripts/Private/Core/Logging/Immutable.Passport.Core.Logging.asmdef
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,14 @@ | ||
{ | ||
"name": "Immutable.Passport.Core.Logging", | ||
"rootNamespace": "", | ||
"references": [], | ||
"includePlatforms": [], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
7 changes: 7 additions & 0 deletions
7
...Passport/Runtime/Scripts/Private/Core/Logging/Immutable.Passport.Core.Logging.asmdef.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
src/Packages/Passport/Runtime/Scripts/Private/Core/Logging/LogLevel.cs
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,28 @@ | ||
namespace Immutable.Passport.Core.Logging | ||
{ | ||
/// <summary> | ||
/// Defines the logging levels used within the SDK to categorise the severity of log messages. | ||
/// </summary> | ||
public enum LogLevel | ||
{ | ||
/// <summary> | ||
/// Logs detailed information for debugging the SDK | ||
/// </summary> | ||
Debug, | ||
|
||
/// <summary> | ||
/// Logs general information about SDK operations | ||
/// </summary> | ||
Info, | ||
|
||
/// <summary> | ||
/// Logs warnings about potential issues or unexpected behaviour | ||
/// </summary> | ||
Warn, | ||
|
||
/// <summary> | ||
/// Logs errors indicating failures in SDK operations | ||
/// </summary> | ||
Error | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Packages/Passport/Runtime/Scripts/Private/Core/Logging/LogLevel.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
src/Packages/Passport/Runtime/Scripts/Private/Core/Logging/PassportLogger.cs
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,58 @@ | ||
using UnityEngine; | ||
|
||
namespace Immutable.Passport.Core.Logging | ||
{ | ||
public static class PassportLogger | ||
{ | ||
private const string TAG = "[Immutable]"; | ||
|
||
public static LogLevel CurrentLogLevel { get; set; } = LogLevel.Info; | ||
|
||
public static void Log(LogLevel level, string message) | ||
{ | ||
if (level < CurrentLogLevel) | ||
{ | ||
return; // Don't log messages below the current log level | ||
} | ||
|
||
switch (level) | ||
{ | ||
case LogLevel.Debug: | ||
UnityEngine.Debug.Log($"{TAG} {message}"); | ||
break; | ||
case LogLevel.Info: | ||
UnityEngine.Debug.Log($"{TAG} {message}"); | ||
break; | ||
case LogLevel.Warn: | ||
UnityEngine.Debug.LogWarning($"{TAG} {message}"); | ||
break; | ||
case LogLevel.Error: | ||
UnityEngine.Debug.LogError($"{TAG} {message}"); | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
|
||
public static void Debug(string message) | ||
{ | ||
Log(LogLevel.Debug, message); | ||
} | ||
|
||
public static void Info(string message) | ||
{ | ||
Log(LogLevel.Info, message); | ||
} | ||
|
||
public static void Warn(string message) | ||
{ | ||
Log(LogLevel.Warn, message); | ||
} | ||
|
||
public static void Error(string message) | ||
{ | ||
Log(LogLevel.Error, message); | ||
} | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/Packages/Passport/Runtime/Scripts/Private/Core/Logging/PassportLogger.cs.meta
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.