Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add operation name in undo/redo console log #15146

Merged

Conversation

forkercat
Copy link
Contributor

What does this PR do?

This PR adds the operation names in undo/redo logs in console.

Before:

After:

How was this PR tested?

Tested in editor

Signed-off-by: Junhao Wang <wjunhao@amazon.com>
Signed-off-by: Junhao Wang <wjunhao@amazon.com>
@forkercat forkercat added feature/editor This item is related to the editor subsystem. sig/content Categorizes an issue or PR as relevant to SIG Content. labels Mar 16, 2023
@forkercat forkercat requested review from a team as code owners March 16, 2023 17:24
@@ -335,7 +342,6 @@ void CUndoManager::Redo(int numSteps)
{
GetIEditor()->UpdateViews(eUpdateObjects);
}
GetIEditor()->GetLogFile()->FormatLine("Redo (Undo:%d,Redo:%d)", m_undoStack.size(), m_redoStack.size());
GetIEditor()->GetObjectManager()->InvalidateVisibleList();
Copy link
Contributor Author

@forkercat forkercat Mar 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move the log to the above while loop. If numSteps is N (>1), it should output for N times.
Also, by putting it there, no assertion is needed for checking the stack size before using node in it.

Copy link
Contributor

@srikappa-amzn srikappa-amzn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition! This should make debugging undo/redo operations easier.

Signed-off-by: Junhao Wang <wjunhao@amazon.com>
@forkercat forkercat merged commit a22b3e8 into o3de:development Mar 17, 2023
2 checks passed
@forkercat forkercat deleted the wjunhao/improve-undo-info branch March 17, 2023 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/editor This item is related to the editor subsystem. sig/content Categorizes an issue or PR as relevant to SIG Content.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants