On 2011-08-23, Roy Smith <r...@panix.com> wrote:
> I want to log a string but only the first bunch of it, and add "..."
> to the end if it got truncated.  This certainly works:

>           logger.error("FAILED: '%s{50}', '%s', %s, %s" % (message,
> route, params, e.code))

> does anything like this exist?

%.50s

-s
-- 
Copyright 2011, all wrongs reversed.  Peter Seebach / usenet-nos...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to