generated from techno-dwarf-works/unity-package-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework BetterLogger to Unity ILogHandler
- Loading branch information
Showing
10 changed files
with
90 additions
and
258 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 was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System; | ||
using UnityEngine; | ||
using Object = UnityEngine.Object; | ||
|
||
namespace Better.Logger.Runtime | ||
{ | ||
internal class LogHandler : ILogHandler | ||
{ | ||
private readonly ILogHandler _defaultLogHandler; | ||
|
||
public LogHandler() | ||
{ | ||
_defaultLogHandler = Debug.unityLogger.logHandler; | ||
} | ||
|
||
public void LogFormat(LogType logType, Object context, string format, params object[] args) | ||
{ | ||
var newFormat = LogBuilder.BuildLogObject(format); | ||
_defaultLogHandler.LogFormat(logType, context, newFormat, args); | ||
} | ||
|
||
public void LogException(Exception exception, Object context) | ||
{ | ||
LogBuilder.BuildLogException(exception, exception.Message); | ||
_defaultLogHandler.LogException(exception, context); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.