Skip to content

Conversation

Hannnnnnn404
Copy link
Contributor

PR Details

Add logging to the project. Well-formed and well-informed logging can help developers quickly locate the root cause when problems occur in the program.

Description

  • Configure different logging levels to express the error levels. The exception is the highest level. The info is the lowest level.
  • Print the log massage to console with the same simple format.
  • When error happens, there are some reminds of the error.

Related Issue

Motivation and Context

Logging is necessary because it can record the error information, status information, debugging information, and execution time information generated when the program is running. In a production environment, logs are an important basis for finding the source of a problem.

How Has This Been Tested

Trigger some exception errors in the program and test the content of the logs of the exception.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • 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

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

File imageFile = new File(path);
if (imageFile.exists()) {
try {
logger.info("Read image form User Successfully.");
Copy link
Owner

Choose a reason for hiding this comment

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

Just because it's a library, we need to move lower logger level for it.
For example: info -> debug

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