Create a SLF4J-compatible logging extension, which can be used to sniff logs
See original GitHub issueclass MyTest : FunSpec(
{
val logs = install(LogSniffer) { minLevel = Level.INFO }
test("check that logs are on correct level and contains id") {
logs.forOne {
it.level shouldBe Level.WARN
it.message shouldContain "myId"
}
}
}
)
Do you think it’s worth adding as an extension (kotest-extensions-logging
?)?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
SLF4J extensions
The log() method logs at level DEBUG using a marker named "PROFILER". If your logging system supports markers, e.g. logback, you could specifically...
Read more >Support the lambda expression in the Logger - QOS.ch JIRA
I just went and tested this and sure enough...it does not work .(but I mean, it should be obvious since slf4j uses the...
Read more >SLF4J Tutorial: Configuration Example for Logging in Java
Learn what is SLF4J and how to configure it using different Java logging libraries, from Log4j and Log4j2 to Logback and Jakarta Commons ......
Read more >Loggers should be "private static final" and should share a ...
Noncompliant Code Example. With a default regular expression of LOG(?:GER)? : public Logger logger = LoggerFactory. · Compliant Solution. private static final ...
Read more >SLF4J: 10 Reasons Why You Should Be Using It - Stackify
You can use Markers in 'special' events or log entries that you want to make them stand out from regular records. Even though...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What about just saying this was a good idea that didn’t work out 😃
@jschneidereit i meant to monitor the logs of the production code. 😃
for instance:
test: