java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java
branchv_0
changeset 55 f5ed7c4efacc
parent 48 28735e71a1da
child 56 29f45ab3b959
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java	Tue Dec 24 14:36:14 2013 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/CLIStarter.java	Wed Dec 25 00:43:06 2013 +0100
     1.3 @@ -44,6 +44,7 @@
     1.4  	private Configuration configuration;
     1.5  
     1.6  	public static void main(String[] args) {
     1.7 +		log.log(Level.FINE, "Starting " + Constants.PROGRAM_NAME);
     1.8  
     1.9  		if (args.length == 0) {
    1.10  			args = new String[]{CLIParser.Tokens.INFO_HELP};
    1.11 @@ -56,6 +57,7 @@
    1.12  			CLIStarter starter = new CLIStarter(options);
    1.13  			starter.installDefaultConfiguration();
    1.14  			starter.process();
    1.15 +			log.log(Level.FINE, "All done");
    1.16  		} catch (CLIParserException e) {
    1.17  			log.log(Level.SEVERE, "Unable to parse CLI options", e);
    1.18  		} catch (InvalidOptionsException e) {
    1.19 @@ -113,6 +115,7 @@
    1.20  				throw new ConfigurationException("Formatter is not configured: " + options.getFormatterName());
    1.21  			} else {
    1.22  				try (DatabaseConnection c = dd.connect()) {
    1.23 +					log.log(Level.FINE, "Database connected");
    1.24  					Formatter f = fd.getInstance(new FormatterContext(options.getOutputStream()));
    1.25  					c.executeQuery(options.getSQLCommand(), f);
    1.26  				}
    1.27 @@ -138,10 +141,11 @@
    1.28  		Constants.DIR.mkdir();
    1.29  
    1.30  		if (Constants.CONFIG_FILE.exists()) {
    1.31 -			log.log(Level.FINE, "Config file already exists: {0}", Constants.CONFIG_FILE);
    1.32 +			log.log(Level.FINER, "Config file already exists: {0}", Constants.CONFIG_FILE);
    1.33  		} else {
    1.34  			try {
    1.35  				Functions.installResource(Constants.EXAMPLE_CONFIG_FILE, Constants.CONFIG_FILE);
    1.36 +				log.log(Level.FINE, "Installing default config file: {0}", Constants.CONFIG_FILE);
    1.37  			} catch (IOException e) {
    1.38  				throw new ConfigurationException("Unable to write example configuration to " + Constants.CONFIG_FILE, e);
    1.39  			}