private String createMessage(ServiceReference sr, String message) {

        StringBuilder output = new StringBuilder();
        if (sr != null) {
            output.append('[').append(sr.toString()).append(']');
        } else {
            output.append(UNKNOWN);
        }
        output.append(message);

        return output.toString();
    }
Formats the log message to indicate the service sending it, if known.

@param sr the ServiceReference sending the message.
@param message The message to log.
@return The formatted log message.
osgi-over-slf4j/src/main/java/org/slf4j/osgi/logservice/impl/LogServiceImpl.java