truncating strings

Seebs usenet-nospam at
Tue Aug 23 22:52:55 CEST 2011

On 2011-08-23, Roy Smith <roy at> 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?


Copyright 2011, all wrongs reversed.  Peter Seebach / usenet-nospam at <-- lawsuits, religion, and funny pictures <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.

More information about the Python-list mailing list