Skip to content

Commit 9cd82f4

Browse files
committed
restored parts of the editor code to enable colorized logging
1 parent 625d60e commit 9cd82f4

4 files changed

Lines changed: 21 additions & 21 deletions

File tree

Assets/OxGFrame/CoreFrame/Scripts/Editor/BindCodeAutoGenerateEditor.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private static bool _HasChild(GameObject selected, GameObject[] selections)
110110
{
111111
if (select.GetInstanceID() == child.gameObject.GetInstanceID())
112112
{
113-
Debug.Log($"Including Child Node => Parent: {selected.name}, Child: {child.name}");
113+
Debug.Log($"<color=#ff2486>Including Child Node => Parent: <color=#ffb824>{selected.name}</color>, Child: <color=#ffec24>{child.name}</color></color>");
114114
return true;
115115
}
116116
}
@@ -433,7 +433,7 @@ private static void _GenerateCodes()
433433
if (string.IsNullOrEmpty(targetCode))
434434
continue;
435435

436-
Debug.Log($"Try comparing with parent class. ScriptPath: {scriptPaths[i]}");
436+
Debug.Log($"<color=#39ffc2>Try comparing with parent class. ScriptPath: {scriptPaths[i]}</color>");
437437
_builder = _RemoveDuplicateLines(_builder, targetCode);
438438
}
439439

@@ -461,7 +461,7 @@ private static void _GenerateCodes()
461461
private static void _ShowClipboard(string content)
462462
{
463463
BindCodeClipboardWindow.ShowWindow(content);
464-
Debug.Log("[Manual] Copy binding content to script!!!");
464+
Debug.Log("<color=#02ff8e>[Manual] Copy binding content to script!!!</color>");
465465
}
466466

467467
/// <summary>
@@ -499,13 +499,13 @@ private static void _InsertCodes(string content)
499499
AssetDatabase.Refresh();
500500
EditorUtility.SetDirty(_script);
501501

502-
Debug.Log("[Auto] Completed automatically binding content to script!!!", _script);
502+
Debug.Log("<color=#02ff8e>[Auto] Completed automatically binding content to script!!!</color>", _script);
503503
}
504504
else
505505
{
506-
Debug.Log($"Unable to find specific replacement string in script. Script Name:{_script.name}", _script);
507-
Debug.Log($"The pattern is ↓↓↓ (Copy the following into the script) ↓↓↓", _script);
508-
Debug.Log($"{_REPLACEMENT_PATTERN_HEAD}\n{_REPLACEMENT_PATTERN_END}");
506+
Debug.LogWarning($"Unable to find specific replacement string in script. Script Name:{_script.name}", _script);
507+
Debug.LogWarning($"The pattern is ↓↓↓ (Copy the following into the script) ↓↓↓", _script);
508+
Debug.LogWarning($"{_REPLACEMENT_PATTERN_HEAD}\n{_REPLACEMENT_PATTERN_END}");
509509
}
510510
}
511511

@@ -518,7 +518,7 @@ private static string _GetScriptPath(MonoBehaviour script)
518518
{
519519
if (script == null)
520520
{
521-
Debug.Log("Cannot find script (FrameBase => UIBase, SRBase, CPBase). Please drag the script onto the object!!!");
521+
Debug.LogWarning("Cannot find script (FrameBase => UIBase, SRBase, CPBase). Please drag the script onto the object!!!");
522522
return null;
523523
}
524524

@@ -654,14 +654,14 @@ private static string _RemoveDuplicateLines(string sourceSection, string targetS
654654
foreach (var v in targetMembers)
655655
{
656656
sourceSection = _RemoveLineContaining(sourceSection, v, false);
657-
Debug.Log($"Removed the intersecting part of variables: {v}");
657+
Debug.Log($"<color=#ff7454>Removed the intersecting part of variables: <color=#ffb854>{v}</color></color>");
658658
}
659659

660660
// 移除賦值
661661
foreach (var v in targetAssignments)
662662
{
663663
sourceSection = _RemoveLineContaining(sourceSection, v, false);
664-
Debug.Log($"Removed the intersecting part of assignments: {v}");
664+
Debug.Log($"<color=#ff7454>Removed the intersecting part of assignments: <color=#ffb854>{v}</color></color>");
665665
}
666666

667667
return sourceSection;

Assets/OxGFrame/CoreFrame/Scripts/Editor/StopEndAutoGenerateEditor.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ private static bool _CheckIsRoot()
3535
{
3636
if (select.GetInstanceID() != select.transform.root.gameObject.GetInstanceID())
3737
{
38-
Debug.Log($"Selected is not a root node => Selected: {select.name}, Root: {select.transform.root.name}", select.transform.root);
38+
Debug.Log($"<color=#ff2486>Selected is not a root node => Selected: <color=#ffb824>{select.name}</color>, Root: <color=#ffec24>{select.transform.root.name}</color></color>", select.transform.root);
3939
return false;
4040
}
4141
}
@@ -97,15 +97,15 @@ internal static void _GenerateStopEndSymbol()
9797
if (endNode == null)
9898
{
9999
endNode = _listGos[lastIdx];
100-
Debug.Log($"Last node is a bind object, doesn't need to generate stop end symbol: {endNode.name}", endNode);
100+
Debug.Log($"<color=#fff472>Last node is a bind object, doesn't need to generate stop end symbol: <color=#72e4ff>{endNode.name}</color></color>", endNode);
101101
return;
102102
}
103103

104104
// 最後綁定物件的下一個節點
105105
Undo.RecordObject(endNode, $"Modified Name with Stop End {endNode.name}");
106106
endNode.name = $"{endNode.name}{FrameConfig.BIND_STOP_END}";
107107

108-
Debug.Log($"Auto generate stop end symbol ({FrameConfig.BIND_STOP_END}) => EndNode: {endNode.name}", endNode);
108+
Debug.Log($"<color=#b5ff72>Auto generate stop end symbol ({FrameConfig.BIND_STOP_END}) => EndNode: <color=#72e4ff>{endNode.name}</color></color>", endNode);
109109
}
110110
else
111111
{
@@ -116,7 +116,7 @@ internal static void _GenerateStopEndSymbol()
116116
Undo.RecordObject(firstChild, $"Modified Name with Stop End {firstChild.name}");
117117
firstChild.name = $"{firstChild.name}{FrameConfig.BIND_STOP_END}";
118118

119-
Debug.Log($"There are no any bind objects, generate stop end symbol to first child: {firstChild.name}", firstChild);
119+
Debug.Log($"<color=#ff72b3>There are no any bind objects, generate stop end symbol to first child: <color=#72e4ff>{firstChild.name}</color></color>", firstChild);
120120
}
121121
// Transform (Prefab)
122122
else if (_listGos.Count > 1 && !_listGos[0].name.Contains("(Environment)"))
@@ -125,7 +125,7 @@ internal static void _GenerateStopEndSymbol()
125125
Undo.RecordObject(firstChild, $"Modified Name with Stop End {firstChild.name}");
126126
firstChild.name = $"{firstChild.name}{FrameConfig.BIND_STOP_END}";
127127

128-
Debug.Log($"There are no any bind objects, generate stop end symbol to first child: {firstChild.name}", firstChild);
128+
Debug.Log($"<color=#ff72b3>There are no any bind objects, generate stop end symbol to first child: <color=#72e4ff>{firstChild.name}</color></color>", firstChild);
129129
}
130130
}
131131
}

Assets/OxGFrame/Hotfixer/Scripts/Editor/HotfixHelper.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ public static void CopyAOTAssembliesToDestination(string dstDir = null)
7070
string dllBytesPath = $"{aotAssembliesDstDir}/{dll}.dll.bytes";
7171
File.Copy(dllPath, dllBytesPath, true);
7272

73-
Debug.Log($"[Copy AOTAssemblies To HotfixCollector] (AOT) {dll}.dll.bytes, Size: {GetBytesToString(bytesSize)}, {dllPath} -> {dllBytesPath}");
73+
Debug.Log($"<color=#a4ff86>[Copy AOTAssemblies To HotfixCollector] (AOT) <color=#ffcbde>{dll}.dll.bytes</color>, <color=#ffb542>Size: {GetBytesToString(bytesSize)}</color>, <color=#42ddff>{dllPath}</color> -> <color=#c686ff>{dllBytesPath}</color></color>");
7474
}
7575

76-
Debug.Log($"AOT Assemblies TotalSize: {GetBytesToString(totalBytesSize)}");
76+
Debug.Log($"<color=#ffb542>AOT Assemblies TotalSize: {GetBytesToString(totalBytesSize)}</color>");
7777
}
7878

7979
/// <summary>
@@ -100,10 +100,10 @@ public static void CopyHotfixAssembliesToDestination(string dstDir = null)
100100
string dllBytesPath = $"{hotfixAssembliesDstDir}/{dll}.bytes";
101101
File.Copy(dllPath, dllBytesPath, true);
102102

103-
Debug.Log($"[Copy Hotfix Assemblies To HotfixCollector] (Hotfix) {dll}.bytes, Size: {GetBytesToString(bytesSize)}, {dllPath} -> {dllBytesPath}");
103+
Debug.Log($"<color=#a4ff86>[Copy Hotfix Assemblies To HotfixCollector] (Hotfix) <color=#ffcbde>{dll}.bytes</color>, <color=#ffb542>Size: {GetBytesToString(bytesSize)}</color>, <color=#42ddff>{dllPath}</color> -> <color=#c686ff>{dllBytesPath}</color></color>");
104104
}
105105

106-
Debug.Log($"Hotfix Assemblies TotalSize: {GetBytesToString(totalBytesSize)}");
106+
Debug.Log($"<color=#ffb542>Hotfix Assemblies TotalSize: {GetBytesToString(totalBytesSize)}</color>");
107107
}
108108

109109
/// <summary>

Assets/OxGFrame/MediaFrame/Scripts/Editor/AudioBaseEditor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ protected virtual async void DrawAudioLengthView()
7070
}
7171

7272
if (audioClip != null)
73-
Debug.Log($"AudioClip Info => Channel: {audioClip.channels}, Frequency: {audioClip.frequency}, Sample: {audioClip.samples}, Length: {audioClip.length}, State: {audioClip.loadState}");
73+
Debug.Log($"<color=#ffe700>AudioClip Info => Channel: {audioClip.channels}, Frequency: {audioClip.frequency}, Sample: {audioClip.samples}, Length: {audioClip.length}, State: {audioClip.loadState}, Preload Audio Data*: {audioClip.preloadAudioData}</color>");
7474
else
75-
Debug.Log($"AudioClip request failed!!!");
75+
Debug.LogError($"AudioClip request failed!!!");
7676

7777
serializedObject.ApplyModifiedProperties();
7878
});

0 commit comments

Comments
 (0)