def getData(self): homeData = None try: homeData = self.getHomeDataFromCache() except CacheInvalidError: homeData = self.getHomeData() if homeData: session = self.getSession(homeData['urlSiteIdMap']) homeData['userInfo'] = session.userInfo homeData['myFavSites'] = session.myFavSites homeData['loggedIn'] = session.loggedIn else: MBLogger.error('Failed to fetch the home information ... ') return (homeData, MBUtils.toJsonStr(homeData) if homeData else None)
def handleThreadException(request, exc_info): """默认的错误发生时回调函数""" traceback.print_exception(*exc_info) MBLogger.error("Error occurred while handling the reqeust[" + str(request.taskID) + "]...", exc_info=True)
def handleError(self, message, errno): MBLogger.error(message) self.handle(errno)
def GET(self): print("hello world") db = web.database(dbn='mysql', db='test', user='******', passwd='asdfgh') print db.select('student', where='id=11')[0] MBLogger.info("hello world from aaron") return _Template.render("home")
def GET(self): print("hello world") db = web.database(dbn='mysql', db='test', user='******', passwd='asdfgh') print db.select('student', where='id=11')[0] MBLogger.info("hello world") return _Template.render("home")