Commits

tbrugz committed 1ee0949

sqldump: better logging

  • Participants
  • Parent commits 0ddeb7d

Comments (0)

Files changed (2)

src/tbrugz/sqldump/SQLDump.java

 		SchemaModelGrabber schemaGrabber = null;
 		//DBMSResources.instance().updateMetaData(null);
 		
+		//class names
+		String grabClassName = sdd.papp.getProperty(PROP_SCHEMAGRAB_GRABCLASS);
+		String processingClassesStr = sdd.papp.getProperty(PROP_PROCESSINGCLASSES);
+		String dumpSchemaClasses = sdd.papp.getProperty(PROP_SCHEMADUMP_DUMPCLASSES);
+		if(grabClassName!=null && dumpSchemaClasses==null) {
+			log.warn("grabber class [prop '"+PROP_SCHEMAGRAB_GRABCLASS+"'] defined but no dumper classes [prop '"+PROP_SCHEMADUMP_DUMPCLASSES+"'] defined");
+		}
+		if(grabClassName==null && dumpSchemaClasses!=null) {
+			log.warn("dumper classes [prop '"+PROP_SCHEMADUMP_DUMPCLASSES+"'] defined but no grab class [prop '"+PROP_SCHEMAGRAB_GRABCLASS+"'] defined");
+		}
+		if(grabClassName==null && dumpSchemaClasses==null && processingClassesStr==null) {
+			log.warn("no grabber [prop '"+PROP_SCHEMAGRAB_GRABCLASS+"'], dumper [prop '"+PROP_SCHEMADUMP_DUMPCLASSES+"'] or processing [prop '"+PROP_PROCESSINGCLASSES+"'] classes defined");
+		}
+		
 		//grabbing model
-		String grabClassName = sdd.papp.getProperty(PROP_SCHEMAGRAB_GRABCLASS);
 		if(grabClassName!=null) {
 			schemaGrabber = (SchemaModelGrabber) getClassInstance(grabClassName, DEFAULT_CLASSLOADING_PACKAGES);
 			if(schemaGrabber!=null) {
 			}
 		}
 		else {
-			log.warn("no schema grab class [prop '"+PROP_SCHEMAGRAB_GRABCLASS+"'] defined");
+			log.debug("no schema grab class [prop '"+PROP_SCHEMAGRAB_GRABCLASS+"'] defined");
 		}
 		
 		String dirToDeleteFiles = sdd.papp.getProperty(PROP_DO_DELETEREGULARFILESDIR);
 		log.debug("DBMSFeatures: "+feats);
 		
 		//processing classes
-		String processingClassesStr = sdd.papp.getProperty(PROP_PROCESSINGCLASSES);
 		if(processingClassesStr!=null) {
 			if(sdd.conn==null) {
 				sdd.conn = SQLUtils.ConnectionUtil.initDBConnection(CONN_PROPS_PREFIX, sdd.papp);
 		}
 		
 		//dumping model
-		String dumpSchemaClasses = sdd.papp.getProperty(PROP_SCHEMADUMP_DUMPCLASSES);
 		if(dumpSchemaClasses!=null) {
 			String dumpClasses[] = dumpSchemaClasses.split(",");
 			for(String dumpClass: dumpClasses) {
 			}
 		}
 		else {
-			log.warn("no schema dumper classes [prop '"+PROP_SCHEMADUMP_DUMPCLASSES+"'] defined");
+			log.debug("no schema dumper classes [prop '"+PROP_SCHEMADUMP_DUMPCLASSES+"'] defined");
 		}
 		
 		}
 			o = Utils.getClassInstance(defaultPackages[countPack]+"."+className);
 			countPack++;
 		}
+		if(o==null) {
+			log.debug("class not found: "+className);
+		}
 		return o;
 	}
 	

src/tbrugz/sqldump/SQLUtils.java

 			} catch (Exception e) {
 				log.warn("error grabbing database/jdbc driver info: "+e);
 				//e.printStackTrace();
+			} catch (AbstractMethodError e) {
+				log.warn("error grabbing database/jdbc driver info: "+e);
 			}
 		}
 	}