@@ -155,6 +155,8 @@ def _main(
155155 logging .debug (f"Applied run configuration: { __conf__ } " )
156156 elif verbose :
157157 logging .basicConfig (level = logging .INFO , format = LOG_FORMAT , datefmt = DATE_FORMAT )
158+ else :
159+ logging .basicConfig (level = logging .WARNING , format = LOG_FORMAT , datefmt = DATE_FORMAT )
158160
159161 if limit and stats :
160162 logging .error ("Cannot specify a limit when using the -s/--stats switch" )
@@ -181,14 +183,6 @@ def _main(
181183 logging .error ("Error: threads must be >= 1" )
182184 return
183185
184- db1 = connect (database1 , threads1 or threads )
185- db2 = connect (database2 , threads2 or threads )
186- dbs = db1 , db2
187-
188- if interactive :
189- for db in dbs :
190- db .enable_interactive ()
191-
192186 start = time .monotonic ()
193187
194188 try :
@@ -199,7 +193,7 @@ def _main(
199193 where = where ,
200194 )
201195 except ParseError as e :
202- logging .error ("Error while parsing age expression: %s" % e )
196+ logging .error (f "Error while parsing age expression: { e } " )
203197 return
204198
205199 differ = TableDiffer (
@@ -210,6 +204,23 @@ def _main(
210204 debug = debug ,
211205 )
212206
207+ if database1 is None or database2 is None :
208+ logging .error (f"Error: Databases not specified. Got { database1 } and { database2 } . Use --help for more information." )
209+ return
210+
211+ try :
212+ db1 = connect (database1 , threads1 or threads )
213+ db2 = connect (database2 , threads2 or threads )
214+ except Exception as e :
215+ logging .error (e )
216+ return
217+
218+ dbs = db1 , db2
219+
220+ if interactive :
221+ for db in dbs :
222+ db .enable_interactive ()
223+
213224 table_names = table1 , table2
214225 table_paths = [db .parse_table_name (t ) for db , t in safezip (dbs , table_names )]
215226
0 commit comments