Through this class, you can obtain logs held by the ConsoleLog feature.
| API | Description |
|---|
| Add(LogType, message, stackTrace) | Adds a log to be output to the ConsoleLog tool. If stackTrace is not specified, it automatically retrieves the stack trace. |
| Clear() | Deletes all stored log information at once. |
| API | Description |
|---|
| LogList | Returns a list of the log information it retains. |
| OnError | This is an event that runs when an error is detected. |
using System.Collections.Generic;
using UnityEngine;
#if NOA_DEBUGGER
using NoaDebugger;
#endif
public class Example
{
void ExampleMethod()
{
#if NOA_DEBUGGER
LinkedList<ConsoleLogEntry> consoleLogList = NoaConsoleLog.LogList;
NoaConsoleLog.Add(UnityEngine.LogType.Error, "log_message", "log_stacktrace");
NoaConsoleLog.Add(UnityEngine.LogType.Error, "log_message");
NoaConsoleLog.OnError += (ConsoleLogEntry log) => Debug.Log("Error detected.");
NoaConsoleLog.Clear();
#endif
}
}