@Override
    public String sanitize(RequestContext ctx, HttpHeaders headers) {
        if (headers.isEmpty()) {
            return headers.isEndOfStream() ? "[EOS]" : "[]";
        }

        final StringBuilder sb = new StringBuilder();
        if (headers.isEndOfStream()) {
            sb.append("[EOS, ");
        } else {
            sb.append('[');
        }

        maskHeaders(headers, sensitiveHeaders, maskingFunction,
                    (header, values) -> sb.append(header).append('=')
                                          .append(values.size() > 1 ?
                                                  values.toString() : values.get(0)).append(", "));

        sb.setCharAt(sb.length() - 2, ']');
        return sb.substring(0, sb.length() - 1);
    }
A sanitizer that sanitizes {@link HttpHeaders} and returns {@link String}.
core/src/main/java/com/linecorp/armeria/common/logging/TextHeadersSanitizer.java