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

Improve logging errors #13327

Merged
merged 4 commits into from
Dec 19, 2023
Merged

Conversation

manuelsblanco
Copy link
Contributor

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

1. Refactoring Log Capture and Formatting: The code for log capture and formatting has been refactored in classes such as org.openqa.selenium.grid.Bootstrap. This enhances readability and maintainability, standardizing error handling by replacing e.printStackTrace() with LOG.severe() for a more consistent and professional logging approach.

2. Adding Logging Capabilities: Introduced logging capabilities in multiple classes, including org.openqa.selenium.grid.jmx.JMXHelper and org.openqa.selenium.grid.jmx.MBean. This improvement aims to increase traceability and ease debugging, allowing for better monitoring and error identification within the system.

3. Enhanced Log Formatting and Exception Handling: Made improvements in log formatting and exception handling, notably in org.openqa.selenium.grid.log.TerseFormatter. The changes are intended to provide clearer and more useful log outputs, facilitating quicker problem identification and resolution.

Motivation and Context

This change is necessary to enhance the project's logging system. By refining the log capture and formatting processes, and introducing improved logging in several classes, the update solves key issues related to error traceability and debugging efficiency. It ensures that error handling is more consistent and logs are clearer, which aids in faster problem identification and resolution. This overall improvement in the logging mechanism significantly contributes to better maintenance and development of the project.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

manuelsblanco and others added 3 commits December 17, 2023 22:57
…ting and org.openqa.selenium.grid.log packages.
The commit introduces a Logger in various classes to handle exceptions more efficiently. Instead of simply outputting exceptions via printStackTrace, they are now logged using java.util.logging.Logger. This improvement allows for enhanced understanding and handling of exception occurrences during execution.
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (343aa78) 58.04% compared to head (f35a4c5) 58.04%.
Report is 1 commits behind head on trunk.

❗ Current head f35a4c5 differs from pull request most recent head b9e7884. Consider uploading reports for the commit b9e7884 to get more accurate results

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #13327   +/-   ##
=======================================
  Coverage   58.04%   58.04%           
=======================================
  Files          88       88           
  Lines        5337     5337           
  Branches      224      224           
=======================================
  Hits         3098     3098           
  Misses       2015     2015           
  Partials      224      224           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @manuelsblanco!

@diemol diemol merged commit dc4114f into SeleniumHQ:trunk Dec 19, 2023
33 of 41 checks passed
@manuelsblanco manuelsblanco deleted the improveLoggingErrors branch December 19, 2023 12:35
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.

3 participants