Last active
July 30, 2018 23:49
-
-
Save wkorando/ec87df9b3e816979446776f813be65a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LogProducingService { | |
private static final Logger LOGGER = LoggerFactory.getLogger(LogProducingService.class); | |
public void writeSomeLoggingStatements(String message) { | |
LOGGER.info("Let's assert some logs! " + message); | |
ExecutorService executor = Executors.newSingleThreadExecutor(); | |
Future<?> future = executor.submit(() -> LOGGER.info("This message is in a separate thread")); | |
do { | |
// wait for future to complete | |
} while (!future.isDone()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment