def test_debug_mode(self): app = Zask(__name__) app.config = self.default_config app.logger.debug("debug") app.logger.info("info") app.logger.error("error") app.logger.exception("exception")
def test_default_config(self): clear_handlers() app = Zask(__name__) app.config = { "DEBUG": True, "ERROR_LOG": "" } init_zerorpc(app) assert app.config['ZERORPC_ACCESS_LOG'] == '/tmp/zerorpc.access.log'
def test_debug_mode(self): clear_handlers() app = Zask(__name__) app.config = self.default_config init_zerorpc(app) print "" channel_logger.error("error") gevent_logger.error("error") core_logger.error("error")
def test_access_log(self): clear_handlers() app = Zask(__name__) app.config = self.default_config init_zerorpc(app) @access_log class MySrv(object): def sleep(self): time.sleep(1) srv = MySrv() print "Should print an access log:" srv.sleep()
def test_prod_mode(self): app = Zask(__name__) app.config = self.default_config app.config['DEBUG'] = False app.config['PRODUCTION_LOGGING_LEVEL'] = 'warning' app.logger.debug("debug") app.logger.info("info") app.logger.warning("warning") app.logger.error("error") app.logger.exception("exception") print '' print 'printing file:' with open(app.config['ERROR_LOG'], 'r') as fin: print fin.read()
def test_prod_mode(self): clear_handlers() app = Zask(__name__) app.config = self.default_config app.config['DEBUG'] = False init_zerorpc(app) channel_logger.error("error") gevent_logger.error("error") core_logger.error("error") print "" print "printing file:" with open(app.config['ERROR_LOG'], 'r') as fin: print fin.read()
def test_default_config(self): clear_handlers() app = Zask(__name__) app.config = {"DEBUG": True, "ERROR_LOG": ""} init_zerorpc(app) assert app.config['ZERORPC_ACCESS_LOG'] == '/tmp/zerorpc.access.log'