Skip to content

Commit

Permalink
LogCalled can now include class name.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hertzole committed Nov 15, 2020
1 parent 753b660 commit d9d8854
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Editor/Processors/LogCalledProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ private static bool ProcessMethods(TypeDefinition type, ModuleDefinition module)
instructions.Clear();

sb.Append(methodFormat);
sb.Replace("%class%", type.Name);
sb.Replace("%CLASS%", type.Name.ToUpperInvariant());
sb.Replace("%method%", method.Name);
sb.Replace("%METHOD%", method.Name.ToUpperInvariant());

Expand Down
2 changes: 1 addition & 1 deletion Editor/Settings/CecilAttributesSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class CecilAttributesSettings : ScriptableObject
[SerializeField]
private bool includeLogsInBuild = true;
[SerializeField]
private string methodLogFormat = "%method% (%parameters%)";
private string methodLogFormat = "%class% %method% (%parameters%)";
[SerializeField]
private string parametersSeparator = ", ";
[SerializeField]
Expand Down
1 change: 1 addition & 0 deletions Editor/Settings/CecilAttributesSettingsGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private static void OnLogCalledSection()

EditorGUILayout.HelpBox("You can format each message to fit your needs. There are some special keywords that can be useful for you.\n" +
"All keywords have an to upper variant. For example: %method% -> %METHOD% turns MyMethod into MYMETHOD.\n" +
"%class% - Class name\n" +
"%method% - Method name\n" +
"%parameters% - List of parameters\n" +
"%property% - Property name\n" +
Expand Down

0 comments on commit d9d8854

Please sign in to comment.