FAQ
How do I configure SLF4J?
To configure SLF$J
Add a log4j-test.properties under the directory of the java test
...
.
- Add the following snippets into your
build.gradle
file.Code Block test {
...
systemProperty "log4j.configuration", "log4j-test.properties"
...
}
...
dependencies {
...
shadow library.java.slf4j_api
...
shadow library.java.slf4j_log4j12
...
// or shadow library.java.slf4j_jdk14
...
}
- The second
...
- dependency
shadow library.java.slf4j_
...
log4j12
is not necessary if another library already provides this dependency
...
- .
Check the dependency included in the dependency tree
...
, execute:
Code Block ./gradlew dependencies
...
.
Check If you encounter
...
an error message like
...
the following.
Panel borderStyle dashed SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
...
- If so, it means there is no SLF4J
...
- .
- Add
library.java.slf4j_log4j12
orlibrary.java.slf4j_jdk14
in
...
- the file.:
How
...
to format code automatically and avoid spotless errors?
You can set up a git precommit hook to always autoformat code, by putting this in .git/hooks/pre-commit
and setting the executable bit.
...