@Override
        public void publish(LogRecord record) {
            if (isLoggable(record)) {
                String formatted = getFormatter().format(record);
                if (record.getLevel().equals(Level.SEVERE)) {
                    colors.println(printer, formatted, ColorTheme.ERROR);
                } else if (record.getLevel().equals(Level.WARNING)) {
                    colors.println(printer, formatted, ColorTheme.WARNING);
                } else {
                    printer.println(formatted);
                }
                // We want to see log messages right away, so flush the printer.
                printer.flush();
            }
        }
Logs messages to the CLI's redirect stderr.
smithy-cli/src/main/java/software/amazon/smithy/cli/LoggingArgumentsHandler.java