splinky has asked for the wisdom of the Perl Monks concerning the following question:
For example, with what I have now, I can do the following:
The output would look like this:printlog("one\ntwo\n"); indentlog(+1); printlog("three\nfour\n"); indentlog(-1); pringlog("five\nsix\n");
Obviously, the PatternLayout class can take care of the prefix, but it doesn't handle embedded newlines. And there's an example of doing indentation in the FAQ, but that's with a custom Appender, and I want that functionality in the Layout class so I can use it with both the File appender and the Screen appender.05/31/06 17:57:37 | one 05/31/06 17:57:37 | two 05/31/06 17:57:37 | three 05/31/06 17:57:37 | four 05/31/06 17:57:37 | five 05/31/06 17:57:37 | six
Surely I'm not the only one that wants something like this. Worst case, I can modify my printlog subroutine to use Log4perl, but I'm hoping for something better than that.
Any suggestions? Thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Indenting, multi-line Log4perl Layout class?
by saintmike (Vicar) on Jun 02, 2006 at 20:47 UTC |