NoaApiLog
Through this class, you can obtain logs held by the APILog function.
APIs
Static Methods
API | Description |
---|---|
Clear() | Deletes all stored log information at once. |
Static Properties
API | Description |
---|---|
LogList | Returns a list of the log information it retains. |
OnError | This is an event that runs when an error is detected. |
OnLogCopied | This event is triggered when a log is copied to the clipboard. |
OnLogDownload | This event is triggered when a log is downloaded. If the event handler returns true, the logs will be downloaded locally. If the event handler returns false, the logs will not be downloaded. Note: When registering this event, the OnLogDownloadWithLogEntries event will be unregistered. |
OnLogDownloadWithLogEntries | This event is triggered when a log is downloaded. If the event handler returns true, the logs will be downloaded locally. If the event handler returns false, the logs will not be downloaded. Note: When registering this event, the OnLogDownload event will be unregistered. |
OnLogSend | This event is triggered when a log is sent. It fires when the [ |
Sample Code
using System.Collections.Generic;
using UnityEngine;
#if NOA_DEBUGGER
using NoaDebugger;
#endif
public class Example
{
void ExampleMethod()
{
#if NOA_DEBUGGER
// Get a list of log information retained by the APILog function.
LinkedList<ApiLogEntry> apiLogList = NoaApiLog.LogList;
// Set an event to be executed when an error is detected.
NoaApiLog.OnError += (ApiLogEntry log) => Debug.Log("Error detected.");
// Set up the event that is triggered when a log is copied to the clipboard.
NoaApiLog.OnLogCopied += (ApiLogEntry log, string clipboardText) => Debug.Log($"Log copied. Clipboard: {clipboardText}");
// Set up the event that is triggered when a log is downloaded.
NoaApiLog.OnLogDownload += (string filename, string jsonData) =>
{
Debug.Log($"Logs download. Filename: {filename}");
// Return true to allow local download.
// Return false to prevent local download.
return true;
};
// Set up the event that is triggered when a log is downloaded.(To retrieve log information)
NoaApiLog.OnLogDownloadWithLogEntries += (string filename, List<ApiLogEntry> logList) =>
{
Debug.Log($"Logs download. Filename: {filename}");
// Return true to allow local download.
// Return false to prevent local download.
return true;
};
// Set up the event that is triggered when a log is sent.
NoaApiLog.OnLogSend += (List<ApiLogEntry> logList) => Debug.Log("Log sent.");
// Delete all logs.
NoaApiLog.Clear();
#endif
}
}