Skip to content

fix: replace printStackTrace with proper logging - #3252

Closed
lxcxjxhx wants to merge 4 commits into
alibaba:masterfrom
lxcxjxhx:fix/replace-printStackTrace-with-logging
Closed

lxcxjxhx wants to merge 4 commits into
alibaba:masterfrom
lxcxjxhx:fix/replace-printStackTrace-with-logging

Conversation

@lxcxjxhx

Copy link
Copy Markdown

Problem

Found 2 active e.printStackTrace() calls in core code:

  1. Arthas.java:167 - in main() method
  2. ArthasBanner.java:81 - in logo loading

Impact

  • Stack traces go directly to stderr instead of through the configured logging system
  • Cannot control log level, format, or output destination
  • Inconsistent with the rest of the codebase which uses AnsiLog and logger

Fix

  • Arthas.java: Replace t.printStackTrace() with AnsiLog.error(t)
  • ArthasBanner.java: Replace e.printStackTrace() with logger.warn(Failed to load logo, e)

Closes #3251

Local environment limitations, relying on CI/CD automated testing.

lxcxjxhx added 3 commits July 29, 2026 17:40
Add clarifying comments to catch blocks in NetUtils and UserStatUtil to explain why exceptions are silently ignored (statistics reporting should not interrupt main workflow).
@CLAassistant

CLAassistant commented Jul 31, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@lxcxjxhx lxcxjxhx closed this by deleting the head repository Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: replace printStackTrace with proper logging

2 participants