[Red5devs] Log messages
Art Clarke
aclarke at vlideshow.com
Wed Oct 29 09:24:08 PST 2008
Paul to help:
public void giveWalterAnExampleInAction() {
String s = "this is an example";
Integer i = new Integer(5);
Double d = new Double(i);
// You can pass in one var arg
log.debug("Here's the string: {}", s);
// You can pass in two var args...
log.debug("Here's the string: {}; here's the integer: {}", s, i);
// But for more than two, you must pass in an array of arguments for expansion
log.debug("Here's the string: {}; here's the integer: {}; and
annoyingly here's the double: {}",
new Object[] { s, i, d});
}
On Wed, Oct 29, 2008 at 8:52 AM, Walter Tak <walter at waltertak.com> wrote:
> What is "e" ?
> What is "job" ?
>
> Can you give us a preferred example if I would want to print , say , a
> simple variable.
> Can you give us a preferred example if I would want to print , say ,
> multiple variables.
>
> I'm sure I can figure this out in 2 minutes but it would be good if it's
> explicitly written down for all other developers, just in case.
>
> Regards,
> Walter
>
> My fellow devs..
> When you create log messages please use this form
> log.error("Job {} execution failed", job.toString(), e);
>
> instead of using string concatenation
>
> log.error("Job " + job.toString() + " execution failed", e);
>
> The logging system is optimized to handle parameter replacements with
> incurring a concat penalty. Ill update the wiki about it one of these days..
>
> _______________________________________________
> Red5devs mailing list
> Red5devs at osflash.org
> http://osflash.org/mailman/listinfo/red5devs_osflash.org
>
>
More information about the Red5devs
mailing list