public static Runnable wrapRunnable(Runnable runnable, Logger logger) {
        return () -> {
            try {
                runnable.run();
            } catch (Throwable throwable) {
                logger.error("[FATAL] Uncaught exception in executor thread {}", Thread.currentThread().getName(), throwable);
            }
        };
    }
Create a new ThreadFactory.

@param pattern The pattern to use.  If this contains %d, it will be
               replaced with a thread number.  It should not contain more
               than one %d.
@param daemon  True if we want daemon threads.
@return The new ThreadFactory.
s3stream/src/main/java/com/automq/stream/utils/ThreadUtils.java