Hi!

> I like the path that exception handling seems to be taking. I'd be
> comfortable moving forward with this version as an initial version for
> full adoption in the lib.

Cool :-)

> Per logging, it looks as if python's native logging can suffice. I would
> like for the verbosity of logging to be available as a parameter in some
> way. For example, have a settings somewhere that specifies the level of
> logging, and outputs based on that setting.

This can actually be configured by the application, usually with a
configuration file. I will provide examples.. The idea here is that the
library logs as much as possible and the application then picks and
chooses of what to log (and where).

That means that caps.py would not need to be changed.

The logging lib also supports things like rotating logfiles, remote
logging, logging by component etc. So you can also choose just to get
messages from e.g. the caps modules but ignoring everything else.

I think it's quite capable but not so well explained in the docs.

Example comes as soon as I have some time to post it or check it in.

-- Christian



> 
> To illustrate:
> 
> settings.py (or something like that) contains a variable:
> 
>    loglevel = 0 (where 0 is none, and 1-5 are mapped to DEBUG, INFO,
>    WARNING, ERROR, CRITICAL)
> 
> then, in caps.py
> 
>    if (loglevel >=1):
>        log(DEBUG, 'log string')
> 
>    if (loglevel >=2):
>        log(INFO, 'log string')
> 
>    if (loglevel >=3):
>        log(WARNING, 'log string')
> 
>    etc, etc
> 
> This would allow for silent applications, or verbose ones, depending on
> the setting....
> 
> Thoughts?
> 
> ~e
> 
> Christian Scholz wrote:
>> Hi!
>>
>> I just checked in some use of exceptions in caps.py and some tests
>> testing them. You can find the exceptions by searching for "exc" and
>> you can find example of how to catch them (or how they actually look
>> like) in tests/caps.txt at the bottom.
>>
>> I also added some deserialization exception at the bottom of caps.py
>> and  separate tests for GET and POST.
>>
>> Those exceptions now also have a string representation which prints
>> out more details instead of just "ResourceNotFound".
>>
>> Included are also the logging changes.
>>
>> Next step might be to add some more high level caps like for catching
>> a login failure.
>>
>> cheers,
>>
>> Christian
>>
>>
>>
>> _______________________________________________
>> Click here to unsubscribe or manage your list subscription:
>> https://lists.secondlife.com/cgi-bin/mailman/listinfo/pyogp
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Click here to unsubscribe or manage your list subscription:
> https://lists.secondlife.com/cgi-bin/mailman/listinfo/pyogp


-- 
Christian Scholz                          Homepage: http://comlounge.net
COM.lounge                                   blog: http://mrtopf.de/blog
Luetticher Strasse 10                                    Skype: HerrTopf
52064 Aachen                             Video Blog: http://comlounge.tv
Tel: +49 241 400 730 0                           E-Mail [EMAIL PROTECTED]
Fax: +49 241 979 00 850                               IRC: MrTopf, Tao_T

neue Show: TOPFtäglich (http://mrtopf.de/blog/category/topf-taglich/)

_______________________________________________
Click here to unsubscribe or manage your list subscription:
https://lists.secondlife.com/cgi-bin/mailman/listinfo/pyogp

Reply via email to