Closed JaXt0r closed 2 months ago
We can overwrite or extend the log functionality. Problem is, that we always get a misaligned Console view.
public static void Log(string message, LogModule module)
{
if (!IsModuleEnabled(module))
return;
_gvrLogHandler.defaultLogHandler.LogFormat(LogType.Log, null, "[{0}] {1}", module, message);
}
public class GvrDebugLogHandler : ILogHandler
{
public ILogHandler defaultLogHandler;
public GvrDebugLogHandler(ILogHandler defaultLogHandler)
{
this.defaultLogHandler = defaultLogHandler;
}
public void LogFormat(LogType logType, string message, GvrDebug.LogModule module)
{
message = string.Join("[", module , "] ", message);
defaultLogHandler.LogFormat(logType, null, message, null);
}
As Unity uses its own console with the "click" and "display" magic, we would need to leverage some new console solution at all. e.g. https://github.com/bbbscarter/UberLogger
Therefore I recommend we are just cautious:
TL;DR: Let's do it as before. :-D
As more and more subsystems (like world loading, animation, etc.) benefit from logs, it clutters our Debug view. The goal is therefore to introduce a system where we filter unwanted logs during development (e.g. via FeatureFlags) and therefore focus on our logs of interest.
Idea: Debug.Log(Feature.WorldMesh, "some message");
This will be either logged or ignored based on settings at startup.
Implementation ideas: