« Return to Thread: PyAMF and logger

Re: PyAMF and logger

by Nick Joyce :: Rate this Message:

Reply to Author | View in Thread

Hi,

In PyAMF 0.4.2 and down, there is no logger kwarg for the Gateway  
class, each instance creates a logger automagically. In the soon to be  
released PyAMF 0.5 all loggers are switched off and you have to supply  
them as shown in the wiki.

You should be able to add a handler to gw.logger as normal and it all  
just work.

I will update the wiki to reflect the current documentation.

Hth,

Nick

On 25 Jun 2009, at 19:35, vitaly@... wrote:

> Hi all,
>
> I'm trying to log the pyAMF request/response like:
>
> logging.basicConfig(
>    level=logging.DEBUG,
>    format='%(asctime)s %(levelname)-5.5s [%(name)s] %(message)s'
> )
> ...
> gateway = TwistedGateway(services, logger=logging,  
> expose_request=False)
> ...
>
> and the following error come up:
>
> File "/usr/share/pyamf/pyamf/remoting/gateway/twisted.py", line 197,  
> in __init__
>    gateway.BaseGateway.__init__(self, *args, **kwargs)
> TypeError: __init__() got an unexpected keyword argument 'logger'
>
>
> I've took the example from:
> http://pyamf.org/wiki/TwistedHowto
> but I run the snip like: python abc.py and not from .tac file.
> All works just fine except while I'm trying to use the logger.
>
> What am I missing guys?
> Or may be there is a more easy way just to log the pyAMF request/
> response?
>
> Appreciate the help.
>
> _______________________________________________
> PyAMF users mailing list - users@...
> http://lists.pyamf.org/mailman/listinfo/users

_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

 « Return to Thread: PyAMF and logger