First you need to get the logger instance. After that, you can call debug, info, warning, error and critical on the logger instance. For example:
from pyblosxom import tools
def cb_prepare(args):
...
logger = tools.getLogger()
logger.info("blah blah blah...")
try:
...
except Exception, e:
logger.error(e)