[Red5devs] Log messages

Mondain mondain at gmail.com
Wed Oct 29 09:11:28 PST 2008


For a warn or error message:- Basic (full block)

    try {
        some code here
    } catch (Exception e) {
        log.error("An error happened", e);
    }

- Detailed (1 param)

    log.error("An error happened for {}", myvar, e);

- Detailed (2 params)

    log.error("An error happened for {} in {}", new Object[]{myvar, myvar2},
e);


For regular log messages (debug, info)

- Basic

    log.info("My {} instanced", myvar);

- Three or more params

    log.info("My {} brown {} jumped over the {} dogs tail", new
Object[]{"quick", "fox", "lazy"});


Thats essentially what needs to go in the wiki..

Paul


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
>
>


-- 
http://gregoire.org/
http://osflash.org/red5
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/red5devs_osflash.org/attachments/20081029/61c2f00e/attachment.html>


More information about the Red5devs mailing list