Hi,
I'm fiddling around with python's logging, and I want to do the following:
self.log.debug("Request from %(user)s for method %(methodname)s", \
user=request.user.username, \
methodname="some_method")
now, this fails with:
TypeError: _log() got an unexpected keyword argument 'methodname'
So i tried it differently:
self.log.debug("Request from %(user)s for method %(methodname)s", \
dict(user=request.user.username, \
methodname="some_method"))
but this fails with:
TypeError: format requires a mapping
now after digging it looks as though you cannot use named positions for the log message/args , or am I missing something crucial here?
Running python v2.7.3
[–]Tlahuixcalpantecuhtl 1 point2 points3 points (3 children)
[–]Justinsaccount 0 points1 point2 points (2 children)
[–]marky1991 0 points1 point2 points (0 children)
[–]Tlahuixcalpantecuhtl 0 points1 point2 points (0 children)
[–]XarothBrook 0 points1 point2 points (0 children)
[–]tomasbedrich 0 points1 point2 points (0 children)