[slf4j-dev] [Bug 148] Add support for Structured Data

bugzilla-daemon at pixie.qos.ch bugzilla-daemon at pixie.qos.ch
Fri Nov 13 11:24:02 CET 2009


http://bugzilla.slf4j.org/show_bug.cgi?id=148





--- Comment #7 from Joern Huxhorn <joern at huxhorn.de>  2009-11-13 11:24:01 ---
This all sounds quite reasonable now.

The only (small) inconsistency that could be an issue is the following line in
your sample code in http://bugzilla.slf4j.org/show_bug.cgi?id=148#c2:

logger.debug("", data);

If this would be

logger.debug("{}", data);

and the toString() would return the formatted message then systems unaware of
StructuredData would still simply print the formatted message.

StructuredData is primarily intended for use in appenders that specifically
support it, right?

Would those be able to handle something like

logger.debug("{} {} {}", "foo", structuredData, "bar")

or is something like that not making sense?


The following is still missing, I'm too lazy for a patch at the moment ;)

  public void putAll(Map map) {
        Iterator iter = map.entrySet().iterator();
        while(iter.hasNext()) {
                Map.Entry current = (Map.Entry) iter.next();
                Object key=current.getKey();
                Object value=current.getValue();
                if( !(key instanceof String) || !(value instanceof String)) {
                        throw new IllegalArgumentException("Both key and value
must be String!");
                }
                put((String)key, (String)value);
        }
  }


-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the slf4j-dev mailing list