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

Inconsistency between ktlint and diktat in logging level when run from command line #1394

Closed
petertrr opened this issue Jun 22, 2022 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@petertrr
Copy link
Member

The following applies to running ktlint+diktat in comand line:

ktlint executalbe jar bundles logback, but doesn't have any config file. Ktlint sets logging level programmatically, but only for a particular logger, that is used in KtLintCommandLine.kt. If neither of --debug, --trace, --verbose flags is present, it sets logback's level to INFO.

However, diktat uses multiple Slf4j loggers. Since no custom config for logback is present, the BasicConfigurator is used and logging level is set to DEBUG. This leads to several debug messages always showing up, see saveourtool/save-cli#401 (comment).

We should include a logback.xml into diktat-ruleset for setting default level to INFO, or try to find a way to share logging level with ktlint.

@petertrr petertrr added the bug Something isn't working label Jun 22, 2022
@petertrr petertrr changed the title Inconsistency between ktlint and diktat in logging level Inconsistency between ktlint and diktat in logging level when run from command line Jun 22, 2022
petertrr added a commit that referenced this issue Jun 30, 2022
### What's done:
* Initialize loggers using kotlin-logging and extension from ktlint-core

This pull request closes #1413. Full description of the problem is in #1394
@orchestr7 orchestr7 assigned petertrr and nulls and unassigned petertrr Sep 13, 2022
@petertrr
Copy link
Member Author

Need to check if it's resolved after we moved to KotlinLogging.loggerWithKtlintConfig in #1424

@nulls
Copy link
Member

nulls commented Nov 30, 2023

fixed by KotlinLogging.loggerWithKtlintConfig
also we have own cli now

@nulls nulls closed this as completed Nov 30, 2023
@nulls nulls removed the backlog label Nov 30, 2023
@nulls nulls added this to the 2.0.0 milestone Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants