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

[Improvement-13491][*] Use lombok @Slf4j annotation to generate logger #13509

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

seedscoder
Copy link
Contributor

Purpose of the pull request

close #13491

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

If your pull request contain incompatible change, you should also add it to docs/docs/en/guide/upgrede/incompatible.md

@codecov-commenter
Copy link

codecov-commenter commented Feb 5, 2023

Codecov Report

Merging #13509 (945b6c7) into dev (3627bf2) will decrease coverage by 0.02%.
The diff coverage is 33.44%.

@@             Coverage Diff              @@
##                dev   #13509      +/-   ##
============================================
- Coverage     39.62%   39.60%   -0.02%     
- Complexity     4357     4379      +22     
============================================
  Files          1097     1097              
  Lines         41161    41155       -6     
  Branches       4715     4714       -1     
============================================
- Hits          16309    16299      -10     
- Misses        23038    23046       +8     
+ Partials       1814     1810       -4     
Impacted Files Coverage Δ
...he/dolphinscheduler/common/thread/ThreadUtils.java 0.00% <0.00%> (ø)
...dolphinscheduler/common/utils/ConnectionUtils.java 0.00% <0.00%> (ø)
.../dao/repository/impl/TaskDefinitionLogDaoImpl.java 3.44% <ø> (-3.22%) ⬇️
...che/dolphinscheduler/dao/upgrade/JsonSplitDao.java 0.00% <0.00%> (ø)
...pache/dolphinscheduler/dao/upgrade/ProjectDao.java 0.00% <0.00%> (ø)
...ache/dolphinscheduler/dao/upgrade/ScheduleDao.java 0.00% <0.00%> (ø)
...ache/dolphinscheduler/dao/utils/H2Performance.java 0.00% <0.00%> (ø)
...e/dolphinscheduler/dao/utils/MySQLPerformance.java 0.00% <0.00%> (ø)
...phinscheduler/dao/utils/PostgreSQLPerformance.java 0.00% <0.00%> (ø)
...scheduler/data/quality/DataQualityApplication.java 0.00% <0.00%> (ø)
... and 298 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

lombok.config Outdated
@@ -16,3 +16,5 @@
#

lombok.addLombokGeneratedAnnotation = true

lombok.log.fieldname=LOGGER
Copy link
Member

Choose a reason for hiding this comment

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

Why we don't keep the default field name log?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Lombok will generate a static final field, so I changed the field name to uppercase. Is this inappropriate? Need to change to lowercase?

@Generated
private static final Logger LOGGER = LoggerFactory.getLogger(Xxx.class);

Why we don't keep the default field name log?

Copy link
Member

Choose a reason for hiding this comment

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

I just think keep the default field name is better, since we already use @Slf4j in some class, this will reduce the change.

@SbloodyS SbloodyS added the 3.2.0 for 3.2.0 version label Feb 6, 2023
@SbloodyS SbloodyS added this to the 3.2.0 milestone Feb 6, 2023
@SbloodyS SbloodyS added the improvement make more easy to user or prompt friendly label Feb 6, 2023
lombok.config Outdated
@@ -16,3 +16,5 @@
#

lombok.addLombokGeneratedAnnotation = true
Copy link
Member

Choose a reason for hiding this comment

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

I prefer that we keep the same formatting of this file. You might either remove the blanks around = in this line or add blanks around = in next line.

@@ -146,13 +146,13 @@
public boolean killTask() {

try {
logger.info("Begin to kill task: {}", taskInstance.getName());
log.info("Begin to kill task: {}", taskInstance.getName());

Check warning

Code scanning / CodeQL

Dereferenced variable may be null

Variable [taskInstance](1) may be null at this access as suggested by [this](2) null guard.
@seedscoder seedscoder force-pushed the issue-13491 branch 4 times, most recently from c882da7 to 1319847 Compare February 7, 2023 08:42
@github-actions github-actions bot removed test e2e e2e test labels Feb 7, 2023
@sonarcloud
Copy link

sonarcloud bot commented Feb 7, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 27 Code Smells

30.0% 30.0% Coverage
4.9% 4.9% Duplication

Copy link
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.2.0 for 3.2.0 version backend improvement make more easy to user or prompt friendly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement][Style] Use lombok @Log annotation to generate loggers
5 participants