protected String argsToString(final Namespace namespace) {
        if (namespace == null) {
            return "";
        } else {
            return namespace.getAttrs()
                    .entrySet()
                    .stream()
                    .filter(entry ->
                            getArgumentNames().contains(entry.getKey()))
                    .filter(entry -> entry.getValue() != null)
                    .flatMap(entry -> {
                        final Object value = entry.getValue();
                        if (value instanceof final List<?> listVal) {
                            return listVal.stream()
                                    .map(item -> Map.entry(entry.getKey(), (Object) item));
                        } else {
                            return Stream.of(entry);
                        }
                    })
                    .sorted(Entry.comparingByKey())
                    .map(entry ->
                            "--" + entry.getKey() + " " + argValueToString(entry.getValue()))
                    .collect(Collectors.joining(" "));
        }
    }
Log to logger as ERROR and stderr

@param template The message template with '{}' placeholders
@param args     The args for the template
stroom-app/src/main/java/stroom/app/commands/AbstractStroomBaseCommand.java