NoaConsoleLogDownloadCallbacks
Configure events related to ConsoleLog downloads.
By passing a class that inherits NoaConsoleLogDownloadCallbacks to NoaConsoleLog, you can customize download-related events.
Overridable Members
Methods
| Name | Description |
|---|---|
| OnBeforeConversion(logEntries) | Executes before converting the target data to a string for download. Both the argument and return value are IReadOnlyList<ConsoleLogEntry>. If you return edited values, they will be reflected in NOA Debugger’s JSON conversion process. |
| OnBeforeDownload(info) | Refer to NoaDownloadCallbacks.OnBeforeDownload(info). |
| OnAfterDownload(info, status) | Refer to NoaDownloadCallbacks.OnAfterDownload(info, status). |
Properties
| Name | Description |
|---|---|
| IsAllowBaseDownload | Refer to NoaDownloadCallbacks.IsAllowBaseDownload. |
Related Types
INoaConsoleLogDownloadCallbacks
NoaConsoleLogDownloadCallbacks.OnBeforeConversion is defined in this interface.
If you want to consolidate multiple callback definitions in a custom class, or add callback functionality while inheriting an existing custom class, you can achieve this by using this interface instead of the NoaConsoleLogDownloadCallbacks class.
Sample Code
#if NOA_DEBUGGER
using NoaDebugger;
using System.Collections.Generic;
using UnityEngine;
// Example of executing events before and after NOA Debugger’s ConsoleLog download process (using a class)
public class ExampleConsoleLogDownloader : NoaConsoleLogDownloadCallbacks
{
public override IReadOnlyList<ConsoleLogEntry> OnBeforeConversion(IReadOnlyList<ConsoleLogEntry> logEntries)
{
Debug.Log($"Logs download. Count: {logEntries.Count}");
// Example of excluding test logs from the download target.
return logEntries.Where(entry => !entry.LogString.Contains("Test")).ToList();
}
// You can also use methods from the base NoaDownloadCallbacks.
public override NoaDownloadInfo OnBeforeDownload(NoaDownloadInfo info)
{
info.FileName = $"Sample-{info.FileName}";
return info;
}
public override void OnAfterDownload(NoaDownloadInfo info, NoaDownloadStatus status)
{
Debug.Log($"Download finished with status: {status}");
}
}
// Example of implementing shared processing across multiple features (using the interface)
public class ExampleCommonDownloader : INoaDownloadCallbacks
{
// Set IsAllowBaseDownload to true to allow NOA Debugger’s download process.
public bool IsAllowBaseDownload => true;
public NoaDownloadInfo OnBeforeDownload(NoaDownloadInfo info)
{
Debug.Log($"Download file name: {info.FileName}");
return info;
}
public void OnAfterDownload(NoaDownloadInfo info, NoaDownloadStatus status)
{
Debug.Log($"Download finished with status: {status}");
}
}
public class ExampleDerivedConsoleLogDownloader : ExampleCommonDownloader, INoaConsoleLogDownloadCallbacks
{
public IReadOnlyList<ConsoleLogEntry> OnBeforeConversion(IReadOnlyList<ConsoleLogEntry> logEntries)
{
Debug.Log($"Logs download. Count: {logEntries.Count}");
return logEntries;
}
}
#endif
