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

Add a warning message for -s option #51

Merged
merged 2 commits into from
Jul 25, 2024
Merged

Conversation

supl
Copy link
Collaborator

@supl supl commented Jul 22, 2024

Description

This PR adds a warning message when the users use the -s option. This is advised in #50

Related issues and/or PRs

#50

Changes made

  • remove the old log4j properties and add the log4j2 properties
  • added new warning message

Checklist

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes.
  • Any remaining open issues linked to this PR are documented and up-to-date (Jira, GitHub, etc.).
  • Tests (unit, integration, etc.) have been added for the changes.
  • My changes generate no new warnings.
  • Any dependent changes in other PRs have been merged and published.

@supl supl self-assigned this Jul 22, 2024
@supl supl force-pushed the add-warning-message branch from 939d775 to 906a08c Compare July 22, 2024 03:02
Comment on lines 1 to 8
# The root logger with appender name
rootLogger = INFO, STDOUT

# Assign STDOUT a valid appender & define its layout
appender.console.name = STDOUT
appender.console.type = Console
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %msg%n
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we forgot to update the property file when we upgraded log4j to version 2.

Copy link
Contributor

@kota2and3kan kota2and3kan left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

FYI: I was able to see the warning message in my local environment as follows!

$ java -jar build/libs/scalar-admin-2.2.0-all.jar -s localhost -c pause
Warning: --srv-service-url, -s will be deprecated in the future. We recommend using --addresses, -a instead.

@@ -107,6 +111,9 @@ public Integer call() {
throw new IllegalArgumentException(
"It's required to specify only either [--srv-service-url, -s] or [--addresses, -a].");
} else if (srvServiceUrl != null) {
logger.error(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
logger.error(
logger.warn(

Why do you use error?
Also, I don't think we need Warnings: header since it's done by the logger.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@feeblefakie

Sorry, it was my typo. It should be warn.

(I remembered I used warn though, anyway.)

Also, I don't think we need Warnings: header since it's done by the logger.

Ah, I see. I did this because I configured the log4j2 output pattern to be just plaintext.

I made a change according to this comment at 27315b4

Please take a look 🙇

@supl supl requested a review from feeblefakie July 23, 2024 09:29
Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

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

LGTM! Thank you!

@feeblefakie feeblefakie merged commit af21390 into main Jul 25, 2024
@feeblefakie feeblefakie deleted the add-warning-message branch July 25, 2024 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants