Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .yamato/config.metadata
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
test_editors:
- version: 6000.0
- version: 6000.3
- version: 6000.5
- version: 6000.6
- version: trunk
8 changes: 5 additions & 3 deletions com.unity.mobile.android-logcat/Editor/AndroidLogcat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using System.Linq;
using UnityEngine;
using System.Text;
using Unity.Scripting.LifecycleManagement;

namespace Unity.Android.Logcat
{
[NoAutoStaticsCleanup]
internal class AndroidLogcat
{
private AndroidLogcatRuntimeBase m_Runtime;
Expand Down Expand Up @@ -458,12 +460,12 @@ internal string LogPrintFormat
get { return m_Device.SupportYearFormat ? kYearTime : kThreadTime; }
}

internal static Regex m_CrashMessageRegex = new Regex(@"^\s*#\d{2}\s*pc\s([a-fA-F0-9]{8}).*(libunity\.so|libmain\.so)", RegexOptions.Compiled);
internal static readonly Regex m_CrashMessageRegex = new Regex(@"^\s*#\d{2}\s*pc\s([a-fA-F0-9]{8}).*(libunity\.so|libmain\.so)", RegexOptions.Compiled);
// Regex for messages produced via 'adb logcat -s -v year *:V'
internal static Regex m_LogCatEntryYearRegex = new Regex(@"(?<date>\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{3})\s+(?<pid>\d+)\s+(?<tid>\d+)\s+(?<priority>[VDIWEFS])\s+(?<tag>.+?)\s*:\s(?<msg>.*)", RegexOptions.Compiled);
internal static readonly Regex m_LogCatEntryYearRegex = new Regex(@"(?<date>\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{3})\s+(?<pid>\d+)\s+(?<tid>\d+)\s+(?<priority>[VDIWEFS])\s+(?<tag>.+?)\s*:\s(?<msg>.*)", RegexOptions.Compiled);

// Regex for messages produced via 'adb logcat -s -v threadtime *:V'
internal static Regex m_LogCatEntryThreadTimeRegex = new Regex(@"(?<date>\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{3})\s+(?<pid>\d+)\s+(?<tid>\d+)\s+(?<priority>[VDIWEFS])\s+(?<tag>.+?)\s*:\s(?<msg>.*)", RegexOptions.Compiled);
internal static readonly Regex m_LogCatEntryThreadTimeRegex = new Regex(@"(?<date>\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2}\.\d{3})\s+(?<pid>\d+)\s+(?<tid>\d+)\s+(?<priority>[VDIWEFS])\s+(?<tag>.+?)\s*:\s(?<msg>.*)", RegexOptions.Compiled);


internal static readonly int kUnityHashCode = "Unity".GetHashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.IO;
using Unity.Profiling;
using UnityEditor;
using Unity.Scripting.LifecycleManagement;
using UnityEngine;

namespace Unity.Android.Logcat
Expand All @@ -20,6 +21,7 @@ namespace Unity.Android.Logcat
/// </summary>
internal class AndroidLogcatCaptureList
{
[NoAutoStaticsCleanup]
static class Styles
{
internal static readonly GUIContent Live = new GUIContent("Live",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
using UnityEngine;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using Unity.Scripting.LifecycleManagement;

namespace Unity.Android.Logcat
{
[NoAutoStaticsCleanup]
internal partial class AndroidLogcatConsoleWindow : EditorWindow, IHasCustomMenu
{
private GUIContent kAutoRunText = new GUIContent(L10n.Tr("Auto Run"), L10n.Tr("Automatically launch logcat window during build & run."));
Expand Down Expand Up @@ -40,7 +42,7 @@ private IReadOnlyList<ProcessInformation> ProcessesForSelectedDevice
private AndroidLogcatInputs m_Inputs;
private DateTime m_TimeOfLastMemoryRequest;

private static string kAutoShowLogcatDuringBuildRun = "AutoShowLogcatDuringBuildRun";
private const string kAutoShowLogcatDuringBuildRun = "AutoShowLogcatDuringBuildRun";

private ProcessInformation SelectedProcess
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ internal struct DeviceInfo

abstract class AndroidLogcatDeviceQueryBase
{
internal static Regex kDeviceInfoRegex = new Regex(@"(?<id>^\S+)\s+(?<state>\S+$)");
internal static readonly Regex kDeviceInfoRegex = new Regex(@"(?<id>^\S+)\s+(?<state>\S+$)");

protected IAndroidLogcatDevice m_SelectedDevice;
protected Dictionary<string, IAndroidLogcatDevice> m_Devices = new Dictionary<string, IAndroidLogcatDevice>();
Expand Down
2 changes: 2 additions & 0 deletions com.unity.mobile.android-logcat/Editor/AndroidLogcatEntry.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System;
using Unity.Scripting.LifecycleManagement;

namespace Unity.Android.Logcat
{
[NoAutoStaticsCleanup]
class LogcatEntry
{
[Flags]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Unity.Android.Logcat
{
internal class AndroidLogcatIPWindow : EditorWindow
{
internal static Regex kIPRegex = new Regex(@"src\s+(?<ip>\d+\.\d+\.\d+\.\d+)");
internal static readonly Regex kIPRegex = new Regex(@"src\s+(?<ip>\d+\.\d+\.\d+\.\d+)");
private AndroidLogcatRuntimeBase m_Runtime;
internal string m_IpString;
internal string m_PortString;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using UnityEditor;
using Unity.Scripting.LifecycleManagement;
using UnityEngine;

namespace Unity.Android.Logcat
Expand All @@ -13,6 +14,7 @@ namespace Unity.Android.Logcat
/// </summary>
internal class AndroidLogcatImageViewer
{
[NoAutoStaticsCleanup]
static class Styles
{
static readonly string kModifier =
Expand Down
2 changes: 2 additions & 0 deletions com.unity.mobile.android-logcat/Editor/AndroidLogcatInputs.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using UnityEditor;
using UnityEngine;
using Unity.Scripting.LifecycleManagement;

namespace Unity.Android.Logcat
{
Expand All @@ -9,6 +10,7 @@ namespace Unity.Android.Logcat
/// </summary>
internal class AndroidLogcatInputs
{
[NoAutoStaticsCleanup]
class KeyResult
{
internal AndroidKeyCode Key { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
using UnityEngine;
using System.Text;
using UnityEditor;
using Unity.Scripting.LifecycleManagement;

namespace Unity.Android.Logcat
{
[NoAutoStaticsCleanup]
internal class AndroidLogcatInternalLog : EditorWindow
{
const int MaxInternalLogMessages = 10000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ internal static void ShowWindow()

class Styles
{
public static GUIContent QueryUIHierarchy = new GUIContent("Query UI Layout");
public static GUIContent SaveUIHierarchy = new GUIContent("Save Layout");
public static GUIContent SaveScreenshot = new GUIContent("Save Screenshot");
public static readonly GUIContent QueryUIHierarchy = new GUIContent("Query UI Layout");
public static readonly GUIContent SaveUIHierarchy = new GUIContent("Save Layout");
public static readonly GUIContent SaveScreenshot = new GUIContent("Save Screenshot");
}

AndroidLogcatRuntimeBase m_Runtime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Threading;
using Unity.Profiling;
using UnityEditor;
using Unity.Scripting.LifecycleManagement;
using UnityEngine;

namespace Unity.Android.Logcat
Expand All @@ -34,6 +35,7 @@ namespace Unity.Android.Logcat
/// because Texture2D can only be touched there.
/// </para>
/// </summary>
[NoAutoStaticsCleanup]
internal class AndroidLogcatLiveStream
{
internal enum Result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AndroidLogcatProjectSettingsProvider : SettingsProvider
internal static readonly string kSettingsPath = "Project/Analysis/Android Logcat Settings";
class Styles
{
public static GUIContent symbolPaths = new GUIContent("Symbol Paths", "Configure symbol paths, used for resolving stack traces.");
public static readonly GUIContent symbolPaths = new GUIContent("Symbol Paths", "Configure symbol paths, used for resolving stack traces.");
}

private AndroidLogcatSymbolList m_SymbolList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Unity.Android.Logcat
{
internal class AndroidLogcatQueryLayout
{
static Regex BoundsRegex = new Regex(@"\[(?<x1>\d+),(?<y1>\d+)\]\[(?<x2>\d+),(?<y2>\d+)\]");
static readonly Regex BoundsRegex = new Regex(@"\[(?<x1>\d+),(?<y1>\d+)\]\[(?<x2>\d+),(?<y2>\d+)\]");

const string NodeTag = "node";
const string ClassTag = "class";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@ internal class AndroidLogcatScreenCaptureWindow : EditorWindow
class Styles
{
// Note: Info acquired from adb shell screenrecord --help
public static GUIContent TimeLimit = new GUIContent("Time Limit", "Toggle to override time limit (in seconds), by default - time limit is 180 seconds.");
public static GUIContent VideoSize = new GUIContent("Video Size", "Toggle to override video size, by default - device's main display resolution is used.");
public static GUIContent BitRate = new GUIContent("Bit Rate", "Toggle to overide bit rate (in Kbps), the default is 2000Kbps.");
public static GUIContent DisplayId = new GUIContent("Display Id", "Toggle to overide the display to record, the default is primary display, enter 'adb shell dumpsys SurfaceFlinger--display - id' in the terminal for valid display IDs. If empty string is provided primary display will be used.");
public static GUIContent ShowInfo = new GUIContent("Show Info", "Display video information.");
public static GUIContent Open = new GUIContent("Open", "Open the recorded video.");
public static GUIContent SaveAs = new GUIContent("Save As", "Save the recorded video as a file on your computer.");
public static readonly GUIContent TimeLimit = new GUIContent("Time Limit", "Toggle to override time limit (in seconds), by default - time limit is 180 seconds.");
public static readonly GUIContent VideoSize = new GUIContent("Video Size", "Toggle to override video size, by default - device's main display resolution is used.");
public static readonly GUIContent BitRate = new GUIContent("Bit Rate", "Toggle to overide bit rate (in Kbps), the default is 2000Kbps.");
public static readonly GUIContent DisplayId = new GUIContent("Display Id", "Toggle to overide the display to record, the default is primary display, enter 'adb shell dumpsys SurfaceFlinger--display - id' in the terminal for valid display IDs. If empty string is provided primary display will be used.");
public static readonly GUIContent ShowInfo = new GUIContent("Show Info", "Display video information.");
public static readonly GUIContent Open = new GUIContent("Open", "Open the recorded video.");
public static readonly GUIContent SaveAs = new GUIContent("Save As", "Save the recorded video as a file on your computer.");
static readonly GUIContent kMore = EditorGUIUtility.IconContent("_Menu");
public static GUIContent Advanced = kMore != null && kMore.image != null
public static readonly GUIContent Advanced = kMore != null && kMore.image != null
? new GUIContent(kMore.image)
: new GUIContent("...");

public static GUIContent TakeScreenshot = new GUIContent("Take Screenshot",
public static readonly GUIContent TakeScreenshot = new GUIContent("Take Screenshot",
"Capture the device screen and add it to the list. The screenshot comes from the device "
+ "rather than from the stream, so it is full resolution whatever the stream is scaled to. "
+ "Shortcut: Ctrl+Shift+S, Cmd+Shift+S on macOS, while this view is showing.");
public static GUIContent CaptureVideo = new GUIContent("Capture", "Record the video from the android device, click Stop afterwards to stop the recording.");
public static GUIContent StopVideo = new GUIContent("Stop", "Stop the recording.");
public static readonly GUIContent CaptureVideo = new GUIContent("Capture", "Record the video from the android device, click Stop afterwards to stop the recording.");
public static readonly GUIContent StopVideo = new GUIContent("Stop", "Stop the recording.");
}
internal enum Mode
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using System.Collections.Generic;
using Unity.Scripting.LifecycleManagement;

namespace Unity.Android.Logcat
{
[NoAutoStaticsCleanup]
internal class AndroidLogcatSendTrimMemoryUsage
{
public string DisplayName { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ internal class AndroidLogcatSettings
// This will force settings to be reset
private const int kVersion = 1;

internal static string kSettingsName = "AndroidLogcatSettings" + kVersion;
internal static readonly string kSettingsName = "AndroidLogcatSettings" + kVersion;

// Since querying memory from device is a lengthy operation, here's a cap 500 ms, setting it too low will make memory request to be delayed
internal static int kMinMemoryRequestIntervalMS = 500;
internal const int kMinMemoryRequestIntervalMS = 500;

// Live stream settings, as default/min/max. The server accepts wider values than
// these, but a stream is only as useful as the link can carry and every frame is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ class AndroidLogcatSettingsProvider : SettingsProvider

class Styles
{
public static GUIContent maxCachedMessageCount = new GUIContent("Max Cached Messages", "The maximum number of unfiltered messages which are kept in the cache and are used when filtering messages. The number of cached messages affects the performing of filtering. 0 - no limit.");
public static GUIContent maxDisplayedMessageCount = new GUIContent("Max Displayed Messages", "The maximum number of messages which are shown in the list, cannot be bigger than cached message count. 0 - no limit.");
public static GUIContent font = new GUIContent("Font", "Font used for displaying messages");
public static GUIContent fontSize = new GUIContent("Font Size");
public static GUIContent stactraceRegex = new GUIContent("Stacktrace Regex", "Configure regex used for resolving function address and library name");
public static GUIContent symbolExtensions = new GUIContent("Symbol Extensions", "Specify which file extension to append while looking for symbol files.");

public static GUIContent requestIntervalMS = new GUIContent("Request Interval ms",
public static readonly GUIContent maxCachedMessageCount = new GUIContent("Max Cached Messages", "The maximum number of unfiltered messages which are kept in the cache and are used when filtering messages. The number of cached messages affects the performing of filtering. 0 - no limit.");
public static readonly GUIContent maxDisplayedMessageCount = new GUIContent("Max Displayed Messages", "The maximum number of messages which are shown in the list, cannot be bigger than cached message count. 0 - no limit.");
public static readonly GUIContent font = new GUIContent("Font", "Font used for displaying messages");
public static readonly GUIContent fontSize = new GUIContent("Font Size");
public static readonly GUIContent stactraceRegex = new GUIContent("Stacktrace Regex", "Configure regex used for resolving function address and library name");
public static readonly GUIContent symbolExtensions = new GUIContent("Symbol Extensions", "Specify which file extension to append while looking for symbol files.");

public static readonly GUIContent requestIntervalMS = new GUIContent("Request Interval ms",
$"How often to request memory dump from the device? The minimum value is {AndroidLogcatSettings.kMinMemoryRequestIntervalMS} ms");
public static GUIContent maxExitedPackageToShow = new GUIContent("Max Exited Packages", "The maximum number of packages in package selection which have exited.");
public static readonly GUIContent maxExitedPackageToShow = new GUIContent("Max Exited Packages", "The maximum number of packages in package selection which have exited.");

public static GUIContent capturesFolder = new GUIContent("Captures Folder",
public static readonly GUIContent capturesFolder = new GUIContent("Captures Folder",
"Where screenshots are written. A relative path starts at the project folder; empty "
+ $"means {AndroidLogcatSettings.kDefaultCaptureOutputDirectory}, which is local to "
+ "this machine and not part of a build.");
public static GUIContent browse = new GUIContent("Browse...", "Pick the captures folder.");
public static readonly GUIContent browse = new GUIContent("Browse...", "Pick the captures folder.");

public static GUIContent liveStreamMaxSize = new GUIContent("Max Size",
public static readonly GUIContent liveStreamMaxSize = new GUIContent("Max Size",
"Longest side of the streamed image in pixels. The device display is scaled down to fit, which is what keeps the bandwidth and the encoding cost on the device down.");
public static GUIContent liveStreamQuality = new GUIContent("JPEG Quality",
public static readonly GUIContent liveStreamQuality = new GUIContent("JPEG Quality",
"Quality of each streamed frame. Lower means a smaller frame and less bandwidth.");
public static GUIContent liveStreamReset = new GUIContent("Reset",
public static readonly GUIContent liveStreamReset = new GUIContent("Reset",
$"Put Max Size, JPEG Quality and Max Frame Rate back to {AndroidLogcatSettings.kLiveStreamMaxSize.Default}, {AndroidLogcatSettings.kLiveStreamQuality.Default} and {AndroidLogcatSettings.kLiveStreamMaxFps.Default}, leaving every other setting alone.");
public static GUIContent liveStreamMaxFps = new GUIContent("Max Frame Rate",
public static readonly GUIContent liveStreamMaxFps = new GUIContent("Max Frame Rate",
"Ceiling on frames per second. A mirrored display only produces a frame when the screen changes, so an idle device sends fewer than this rather than exactly this.");
}

Expand Down
Loading