Skip to content

Commit

Permalink
log the reason when we restart the request
Browse files Browse the repository at this point in the history
fix #110
  • Loading branch information
benoitc committed Aug 30, 2013
1 parent 51c39b7 commit 577404a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions restkit/wrappers.py
Expand Up @@ -5,6 +5,7 @@

import cgi
import copy
import logging
import mimetypes
import os
from StringIO import StringIO
Expand All @@ -19,6 +20,8 @@
from restkit.util import to_bytestring
from restkit.util import parse_cookie

log = logging.getLogger(__name__)

class Request(object):

def __init__(self, url, method='GET', body=None, headers=None):
Expand Down Expand Up @@ -143,6 +146,8 @@ def maybe_rewind(self, msg=""):
not isinstance(self.body, types.StringTypes):
raise RequestError("error: '%s', body can't be rewind."
% msg)
if log.isEnabledFor(logging.DEBUG):
log.debug("restart request: %s" % msg)


class BodyWrapper(object):
Expand Down

0 comments on commit 577404a

Please sign in to comment.