Skip to content

fix(logging): Replace printStackTrace() with proper logging#850

Merged
TommyLemon merged 1 commit intoTencent:masterfrom
hobostay:fix/logging-replace-printstacktrace
Feb 18, 2026
Merged

fix(logging): Replace printStackTrace() with proper logging#850
TommyLemon merged 1 commit intoTencent:masterfrom
hobostay:fix/logging-replace-printstacktrace

Conversation

@hobostay
Copy link
Contributor

Summary

Replace all e.printStackTrace() calls with Log.e() to follow best practices for error handling and logging.

Changes

This PR replaces all instances of e.printStackTrace() with proper logging using the project's Log.e() method, providing:

  • Consistent logging format with timestamps
  • Better error tracking in production environments
  • Controllable logging via Log.DEBUG flag
  • More meaningful error messages with context

Files Modified

  • AbstractSQLExecutor.java: 9 replacements (ResultSet close, transaction errors, connection close)
  • AbstractParser.java: 6 replacements (parse errors, transaction commit/rollback)
  • JSONRequest.java: 1 replacement (JSON parse error)
  • JSR223ScriptExecutor.java: 1 replacement (script compilation error)

Type

  • Bug Fix (improves error handling and debugging)
  • Feature
  • Refactoring
  • Documentation

Checklist

  • Tests pass locally
  • Follows project coding style
  • Self-review completed
  • Commit messages follow guidelines

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

Replace all e.printStackTrace() calls with Log.e() to follow best
practices for error handling and logging. This provides:

- Consistent logging format with timestamps
- Better error tracking in production
- Ability to control logging via Log.DEBUG flag
- More meaningful error messages with context

Changes:
- AbstractSQLExecutor.java: 9 replacements
- AbstractParser.java: 6 replacements
- JSONRequest.java: 1 replacement
- JSR223ScriptExecutor.java: 1 replacement

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@TommyLemon TommyLemon merged commit 696af70 into Tencent:master Feb 18, 2026
1 check passed
@TommyLemon
Copy link
Collaborator

@hobostay
Thank you, especially when it's in spring festival.
Happy new year~

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.

2 participants