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





--- Comment #7 from Joern Huxhorn <[email protected]>  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.
_______________________________________________
dev mailing list
[email protected]
http://www.slf4j.org/mailman/listinfo/dev

Reply via email to