Example #1
0
def bbpgsql_main(argv):
    cmd_name = basename(argv[0])
    dispatch_map = get_dispatch_map()
    if cmd_name in dispatch_map:
        options, args = non_destructive_minimal_parse_and_validate_args(argv)
        get_config_from_filename_and_set_up_logging(options.config_file)
        try:
            dispatch_map[cmd_name]()
        except Exception, e:
            get_logger().exception(str(e))
            logging.shutdown()
            stdout.write('\nERROR: %s' % str(e))
            exit(1)
 def test_logger_name_is_as_expected(self):
     self.assertEqual('bbpgsql', get_logger().name)