Skip to content

Log capturing - for testing, logging assertions and silencing noisy expected error logs from unit tests

Notifications You must be signed in to change notification settings

RWS/log-capture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

log-capture

Log capturing - for testing, logging assertions and silencing noisy expected error logs from unit tests

Status

This module is work in progress. I'll remove this message when ready.

Usage

Capture logs

   LogCapture logCapture = LogCapture.capture("ROOT").atLevel(Level.ERROR);
   try {
       ...
   } finally {
       logCapture.stop();
   }
   assertEquals("Expected Message", logCapture.toList().get(0));

Suppress logs during a try block

   try (LogCapture.capture("ROOT").atLevel(Level.ERROR)) {
       ...
   }

About

Log capturing - for testing, logging assertions and silencing noisy expected error logs from unit tests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages