Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Print a partitioned log4perl message with proper indent

by #perl_noob (Acolyte)
on Apr 17, 2017 at 06:37 UTC ( #1188089=perlquestion: print w/replies, xml ) Need Help??
#perl_noob has asked for the wisdom of the Perl Monks concerning the following question:

I am using log4perl for logging to a Screen Appender. The issue that I am facing is if there is a relatively large message, when it gets printed on the terminal, a word in broken down and printed in two separate lines like log4perl is printed as log4\nperl.

I am able to partition the message and it prints well. But when tags (%p %d %F etc.) are introduced before %m in pattern layout, it breaks the word while printing. I want to get the length of the contents that were printed before %m to modify the partition method accordingly.

Any leads would be helpful. Would prefer a way other than reserving characters for the placeholders since any one can change the pattern layout in the config file. Thank you.

  • Comment on Print a partitioned log4perl message with proper indent

Replies are listed 'Best First'.
Re: Print a partitioned log4perl message with proper indent
by Anonymous Monk on Apr 17, 2017 at 06:49 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1188089]
Front-paged by Corion
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2017-06-25 12:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (567 votes). Check out past polls.