[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Comments System



On Thu, 2006-04-06 at 19:42 -0400, Kris Schnee wrote:
> def Comment(self,what):
>      if self.comments:
>          print "["+self.name+"] "+str(what)

Why not to use the standard logging module?
It is very powerful and flexible.

Usage example:
import logging
logging.warning("help me")

try:
    raise Exception("sample error")
except:
    logging.exception("got it, look:")

log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
log.debug("""message from specific logger""")

##########

Logging module documentation:
http://www.python.org/doc/lib/module-logging.html
Basic example:
http://www.python.org/doc/lib/minimal-example.html

-- 
Ivo Danihelka