|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
|
|
|
Re: MessageFormatter: brackets in bracketsHello Jean-Luc,
Thank you for your message. Comments inline. Jean-Luc Geering wrote: > Hi there, > > On [1] I read that > > " In case your message contains the '{' or the '}' character, you do not > have to do anything special unless the '}' character immediately follows > '}' " > > shouldn't it be " ... unless the '}' character immediately follows '{' " ? Yes, absolutely. Fixed in revision 1153. > and related to that, if I want to produce "hello{world}", shouldn't I be > able to write log.debug("hello{{}}, "world"); ? Yes. You can write log.debug("hello{{}}, "world"); which will produce the message "hello {world}" assumming the logger is enabled for the debug level. Are you observing a different behavior? -- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch _______________________________________________ user mailing list user@... http://www.slf4j.org/mailman/listinfo/user |
|
|
|
|
|
Re: MessageFormatter: brackets in bracketsHello Jean-Luc, Could you please describe what you are doing (=code source) and the results obtained? For example, Logger logger = LoggerFactory.getLogger("test1"); logger.info("Hello {{}}"); yields (with slf4j-simple.jar) 0 [main] INFO test1 - Hello {{}} and Logger logger = LoggerFactory.getLogger("test2"); logger.info("Hello {{}}", "world"); yields (with slf4j-simple.jar) 0 [main] INFO test2 - Hello {world} Does the above differ from what you observe or are you trying to do something else? Cheers, Jean-Luc Geering wrote: > Hi Ceki, > > Thanks for the quick reply and for the presentation yesterday (JUGS event)! > > I do have a problem with "{{}}" (i.e. no formatting, have "{{}}" in the log), > using slf4j-api-1.5.2 and slf4j-log4j12-1.5.2. > > I quickly tested with 1.5.3, and get the same behavior. > Bug? My fault? Do you need more details? > > JL > > ----- Original Message ----- > From: "Ceki Gulcu" <listid@...> > To: "User list for the slf4j project" <user@...> > Sent: Wednesday, October 1, 2008 3:19:12 PM GMT +01:00 Amsterdam / Berlin / Bern / Rome / Stockholm / Vienna > Subject: Re: [slf4j-user] MessageFormatter: brackets in brackets > > Hello Jean-Luc, > > Thank you for your message. Comments inline. > > Jean-Luc Geering wrote: >> Hi there, >> >> On [1] I read that >> >> " In case your message contains the '{' or the '}' character, you do not >> have to do anything special unless the '}' character immediately follows >> '}' " >> >> shouldn't it be " ... unless the '}' character immediately follows '{' " ? > > Yes, absolutely. Fixed in revision 1153. > > >> and related to that, if I want to produce "hello{world}", shouldn't I be >> able to write log.debug("hello{{}}, "world"); ? > > Yes. You can write > > log.debug("hello{{}}, "world"); > > which will produce the message "hello {world}" assumming the logger is enabled > for the debug level. > > Are you observing a different behavior? > -- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch _______________________________________________ user mailing list user@... http://www.slf4j.org/mailman/listinfo/user |
|
|
Re: MessageFormatter: brackets in bracketsOk, I think it is fixed in 1.5.3
with slf4j-simple-1.5.2.jar Logger log = LoggerFactory.getLogger("test"); log.info("{{}}", "hello"); yields 1 [main] INFO test - {{}} but with slf4j-simple-1.5.3.jar it yields 1 [main] INFO test - {hello} soooo, I was wrong. It is fixed in the latest version! (right?) JL ----- Original Message ----- Hello Jean-Luc, Could you please describe what you are doing (=code source) and the results obtained? For example, Logger logger = LoggerFactory.getLogger("test1"); logger.info("Hello {{}}"); yields (with slf4j-simple.jar) 0 [main] INFO test1 - Hello {{}} and Logger logger = LoggerFactory.getLogger("test2"); logger.info("Hello {{}}", "world"); yields (with slf4j-simple.jar) 0 [main] INFO test2 - Hello {world} Does the above differ from what you observe or are you trying to do something else? Cheers, Jean-Luc Geering wrote: > Hi Ceki, > > Thanks for the quick reply and for the presentation yesterday (JUGS event)! > > I do have a problem with "{{}}" (i.e. no formatting, have "{{}}" in the log), > using slf4j-api-1.5.2 and slf4j-log4j12-1.5.2. > > I quickly tested with 1.5.3, and get the same behavior. > Bug? My fault? Do you need more details? > > JL > > ----- Original Message ----- > > Hello Jean-Luc, > > Thank you for your message. Comments inline. > > Jean-Luc Geering wrote: >> Hi there, >> >> On [1] I read that >> >> " In case your message contains the '{' or the '}' character, you do not >> have to do anything special unless the '}' character immediately follows >> '}' " >> >> shouldn't it be " ... unless the '}' character immediately follows '{' " ? > > Yes, absolutely. Fixed in revision 1153. > > >> and related to that, if I want to produce "hello{world}", shouldn't I be >> able to write log.debug("hello{{}}, "world"); ? > > Yes. You can write > > log.debug("hello{{}}, "world"); > > which will produce the message "hello {world}" assumming the logger is enabled > for the debug level. > > Are you observing a different behavior? > -- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch _______________________________________________ user mailing list user@... http://www.slf4j.org/mailman/listinfo/user _______________________________________________ user mailing list user@... http://www.slf4j.org/mailman/listinfo/user |
|
|
Re: MessageFormatter: brackets in bracketsJean-Luc Geering wrote: > Ok, I think it is fixed in 1.5.3 > > with slf4j-simple-1.5.2.jar > > Logger log = LoggerFactory.getLogger("test"); > log.info("{{}}", "hello"); > > yields > > 1 [main] INFO test - {{}} > > but with slf4j-simple-1.5.3.jar it yields > > 1 [main] INFO test - {hello} > > soooo, I was wrong. It is fixed in the latest version! (right?) Hello Jean-Luc, The formatting logic was simplified in 1.5.3, so yes. -- Ceki Gülcü _______________________________________________ user mailing list user@... http://www.slf4j.org/mailman/listinfo/user |
| Free Forum Powered by Nabble | Forum Help |