Custom Logging
Log flags
Set arena.logflags to dejavu.logflags.SQL + whatever other flags you want:
logflags.ERROR = 1 logflags.IO = 2 logflags.SQL = 4 logflags.MEMORIZE = 128 logflags.RECALL = 256 logflags.VIEW = 512 logflags.REPRESS = 1024 logflags.FORGET = 2048 logflags.SANDBOX = (logflags.MEMORIZE | logflags.RECALL | logflags.VIEW | logflags.REPRESS | logflags.FORGET)
Log handlers
If you want to handle logging with some handler other than the builtin "print" handler, override arena.log(self, message) with your own log function. For example, to use the stdlib logging module:
def mylog(message): if isinstance(message, unicode): message = message.encode('utf8') log = logging.getLogger("myapp") log.log(logging.DEBUG, message) arena.log = mylog
