def test_clear_loggers(self): self.app.setup() han = handler.get('log', 'logging') Log = han() Log.clear_loggers(self.app._meta.label) previous_logger = logging.getLogger('previous_logger') MyLog = ext_logging.LoggingLogHandler(clear_loggers='previous_logger') MyLog._setup(self.app)
def test_clear_loggers(self): self.app.setup() han = handler.get('log', 'logging') Log = han() Log.clear_loggers(self.app._meta.label) MyLog = ext_logging.LoggingLogHandler(clear_loggers="%s:%s" % (self.app._meta.label, self.app._meta.label)) MyLog._setup(self.app)
def test_passed_handlers(self): from cement.ext import ext_configparser from cement.ext import ext_logging from cement.ext import ext_argparse from cement.ext import ext_plugin from cement.ext import ext_nulloutput # forces CementApp._resolve_handler to register the handler from cement.ext import ext_json app = self.make_app('my-app-test', config_handler=ext_configparser.ConfigParserConfigHandler, log_handler=ext_logging.LoggingLogHandler(), arg_handler=ext_argparse.ArgParseArgumentHandler(), extension_handler=extension.CementExtensionHandler(), plugin_handler=ext_plugin.CementPluginHandler(), output_handler=ext_json.JsonOutputHandler(), argv=[__file__, '--debug'] ) app.setup()