def handle(self, args): # use the CLI parser to check that the first args is a valid command options = self.parser.parse_args(args) if options.debug: # Install Post-Mortem debugger hook def info(type, value, tb): traceback.print_exception(type, value, tb) print debugger.pm() sys.excepthook = info filename = options.log_filename if filename is None: filename = os.path.join( options.nxdrive_home, 'logs', 'nxdrive.log') configure( filename, file_level=options.log_level_file, console_level=options.log_level_console, process_name=options.command, ) self.controller = Controller(options.nxdrive_home) handler = getattr(self, options.command, None) if handler is None: raise NotImplementedError( 'No handler implemented for command ' + options.command) return handler(options)
def configure_logger(): formatter = logging.Formatter( "%(thread)-4d %(module)-14s %(levelname).1s %(message)s") configure( console_level="TRACE", command_name="test", force_configure=True, formatter=formatter, )
def configure_logs(): """Configure the logging module.""" from nxdrive.logging_config import configure configure( console_level="DEBUG", command_name="test", force_configure=True, )
def configure_logs(): """Configure the logging module to prevent too many data being logged.""" from nxdrive.logging_config import configure configure( console_level="WARNING", file_level="WARNING", command_name="volume", force_configure=True, )
def configure_logs(): """Configure the logging module.""" formatter = logging.Formatter( "%(thread)-4d %(module)-14s %(levelname).1s %(message)s" ) configure( console_level="DEBUG", command_name="test", force_configure=True, formatter=formatter, )
def configure_logs(): """Configure the logging module.""" from nxdrive.logging_config import configure formatter = logging.Formatter( "%(thread)-4d %(module)-14s %(levelname).1s %(message)s") configure( console_level="DEBUG", command_name="test", force_configure=True, formatter=formatter, )
def configure_logs(): """Configure the logging module to prevent too many data being logged.""" from nxdrive.logging_config import configure formatter = logging.Formatter( "%(thread)-4d %(module)-14s %(levelname).1s %(message)s") configure( console_level="WARNING", file_level="WARNING", command_name="volume", force_configure=True, formatter=formatter, )
def _configure_logger(self, options): """Configure the logging framework from the provided options""" filename = options.log_filename if filename is None: filename = os.path.join( options.nxdrive_home, 'logs', 'nxdrive.log') configure( use_file_handler=True, log_filename=filename, file_level=options.log_level_file, console_level=options.log_level_console, command_name=options.command, )
def _configure_logger(self, options): """Configure the logging framework from the provided options""" # Ensure the log folder exists folder_log = os.path.expanduser( os.path.join(options.nxdrive_home, 'logs')) if not os.path.exists(folder_log): os.makedirs(folder_log) filename = options.log_filename if filename is None: filename = os.path.join(options.nxdrive_home, 'logs', 'nxdrive.log') configure( use_file_handler=True, log_filename=filename, file_level=options.log_level_file, console_level=options.log_level_console, command_name=options.command, )
def _configure_logger(self, command, options): # type: (unicode, argparse.ArgumentParser) -> None """ Configure the logging framework from the provided options. """ # Ensure the log folder exists folder_log = os.path.expanduser( os.path.join(options.nxdrive_home, 'logs')) if not os.path.exists(folder_log): os.makedirs(folder_log) filename = options.log_filename if filename is None: filename = os.path.join( options.nxdrive_home, 'logs', 'nxdrive.log') configure( use_file_handler=True, log_filename=filename, file_level=options.log_level_file, console_level=options.log_level_console, command_name=command, )
def configure_logger(): configure( console_level=DEFAULT_CONSOLE_LOG_LEVEL, command_name='test', )
def configure_logger(): configure( console_level='DEBUG', command_name='test', force_configure=True, )
def configure_logger(): configure( file_level='DEBUG', console_level='DEBUG', command_name='test', )
def configure_logger(): configure( console_level='DEBUG', command_name='test', )
def configure_logger(): configure(console_level="DEBUG", command_name="test", force_configure=True)