NoaDebuggerNoaDebugger
  • v1.6.0
  • v1.5.0
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.1.0
  • v1.0.0
Demo
Contact
Buy
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • v1.6.0
  • v1.5.0
  • v1.4.0
  • v1.3.0
  • v1.2.0
  • v1.1.0
  • v1.0.0
Demo
Contact
Buy
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • 日本語
  • English
  • NoaApiLog

NoaApiLog

Through this class, you can obtain logs held by the APILog function.

APIs

Static Methods

APIDescription
Clear()Deletes all stored log information at once.

Static Properties

APIDescription
LogListReturns a list of the log information it retains.
OnErrorThis is an event that runs when an error is detected.
OnLogCopiedThis event is triggered when a log is copied to the clipboard.
OnLogDownloadThis 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.
OnLogDownloadWithLogEntriesThis 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.
OnLogSendThis event is triggered when a log is sent.
It fires when the [send Send] button of the APILog tool is clicked.

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
    }
}