List of usage examples for java.util.logging Level SEVERE
Level SEVERE
To view the source code for java.util.logging Level SEVERE.
Click Source Link
From source file:business.management.system.Chart.java
/** * @param args the command line arguments */// w w w . j av a2 s . c o m public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(Chart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Chart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Chart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Chart.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ }
From source file:de.teamgrit.grit.main.Boot.java
/** * Starts grit./*from www . j a va 2 s . co m*/ * * @param args * used for setting a custom port to reach the grit server at */ public static void main(String[] args) { s_controller = Controller.getController(); if (!BootHelpers.checkRequirements()) { LOGGER.severe("Requirements are not satisfied. Aborting boot."); /* * This println command is necessary, because to boot the system * you need to be logged in and you have to see this message to * find the cause of the fail. */ System.err.println("Could not start system due to missing programs." + " Take a look at the log for further details."); return; } try { loadConfig(); } catch (IOException | ConfigurationException | BadConfigException e) { LOGGER.severe("Could not load the config: " + e.getMessage()); return; } try { loadState(); } catch (IOException | ConfigurationException e) { LOGGER.severe("Could not restore the state of GRIT : " + e.getMessage()); } int port = s_controller.getConfig().getServerPort(); if ((args != null) && (args.length > 0) && args[0].matches("\\d+")) { port = Integer.parseInt(args[0]); } server = new GritServer(port); try { server.start(); server.join(); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Unhandled error: " + e.getMessage(), e); } }
From source file:evalita.q4faq.baseline.Index.java
/** * @param args the command line arguments *///w w w .java 2s .c o m public static void main(String[] args) { try { if (args.length > 1) { Reader in = new FileReader(args[0]); IndexWriterConfig config = new IndexWriterConfig(Version.LATEST, new ItalianAnalyzer()); IndexWriter writer = new IndexWriter(FSDirectory.open(new File(args[1])), config); Iterable<CSVRecord> records = CSVFormat.EXCEL.withHeader().withDelimiter(';').parse(in); for (CSVRecord record : records) { int id = Integer.parseInt(record.get("id")); String question = record.get("question"); String answer = record.get("answer"); String tag = record.get("tag"); Document doc = new Document(); doc.add(new StringField("id", String.valueOf(id), Field.Store.YES)); doc.add(new TextField("question", question, Field.Store.NO)); doc.add(new TextField("answer", answer, Field.Store.NO)); doc.add(new TextField("tag", tag.replace(",", " "), Field.Store.NO)); writer.addDocument(doc); } writer.close(); } else { throw new IllegalArgumentException("Number of arguments not valid"); } } catch (IOException | IllegalArgumentException ex) { Logger.getLogger(Index.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.bytecode.util.Crypto.java
public static void main(String args[]) { try {//w ww .j ava 2s. c om System.out.println("Hello world:" + Crypto.decrypt256(VANSO_KEY, "eQDUrpkbc1R0IMw/hGbWPK4=")); } catch (Exception ex) { Logger.getLogger(Crypto.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:es.jamisoft.comun.utils.cipher.Cifrado3DES.java
public static void main(String args[]) { try {/* w ww .j a va 2s . c om*/ CifradoDES crypt = new CifradoDES(); String encrypted = crypt.cifra("Adios"); System.out.println("Encrypted: " + encrypted); System.out.println("Decrypted: " + crypt.descifra(encrypted)); } catch (EncoderException ex) { Logger.getLogger(Cifrado3DES.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:edu.fullerton.timeseriesapp.TimeSeriesApp.java
/** * @param args the command line arguments *///w ww . j a va 2 s . c om public static void main(String[] args) { int stat; startMs = System.currentTimeMillis(); try { TimeSeriesApp me = new TimeSeriesApp(); // decode command line and set parameters boolean doit = me.processArgs(args); // generate image if (doit) { stat = me.doPlot(); } else { stat = 10; } } catch (Exception ex) { Logger.getLogger(TimeSeriesApp.class.getName()).log(Level.SEVERE, null, ex); stat = 11; } // timing info double elapsedSec = (System.currentTimeMillis() - startMs) / 1000.; System.out.format("Run time: %1$.2f sec%n", elapsedSec); System.exit(stat); }
From source file:malware_classification.Malware_Classification.java
/** * @param args the command line arguments. Order is malicious_filename, * benign filename, (optional) bin_size/*from w w w.j av a2 s . com*/ */ public static void main(String[] args) { String malicious_file_path = args[0]; String benign_file_path = args[1]; int curr_bin_size; if (args.length > 2) { curr_bin_size = Integer.parseInt(args[2]); } else { curr_bin_size = -1; } String pid_str = ManagementFactory.getRuntimeMXBean().getName(); logger.setLevel(Level.CONFIG); logger.log(Level.INFO, pid_str); boolean found_file = false; String output_base = "std_output"; File output_file = null; for (int i = 0; !found_file; i++) { output_file = new File(output_base + i + ".txt"); found_file = !output_file.exists(); } FileHandler fh = null; try { fh = new FileHandler(output_file.getAbsolutePath()); } catch (IOException ex) { Logger.getLogger(Malware_Classification.class.getName()).log(Level.SEVERE, null, ex); } catch (SecurityException ex) { Logger.getLogger(Malware_Classification.class.getName()).log(Level.SEVERE, null, ex); } logger.addHandler(fh); logger.info("Writing output in " + output_file.getAbsolutePath()); Malware_Classification classifier = new Malware_Classification(malicious_file_path, benign_file_path, curr_bin_size); // classifier.run_tests(); }
From source file:com.hurence.logisland.util.string.Anonymizer.java
public static void main(String[] args) { try {/* w w w . j ava 2 s . co m*/ Anonymizer anon = new Anonymizer(); String ip1 = "123.90.3.23"; String ip2 = "123.90.3.24"; System.out.println(anon.anonymize(ip1)); System.out.println(anon.anonymize(ip1)); System.out.println(anon.anonymize(ip2)); String url = "http://www.google.com/support/enterprise/static/gsa/docs/admin/70/gsa_doc_set/integrating_apps/images/google_logo.png"; System.out.println(anon.anonymizeKeepExtension(url)); } catch (NoSuchAlgorithmException | InvalidKeySpecException ex) { Logger.getLogger(Anonymizer.class.getName()).log(Level.SEVERE, null, ex); } }
From source file:com.versusoft.packages.jodl.gui.CommandLineGUI.java
public static void main(String args[]) throws SAXException, IOException { Handler fh = new FileHandler(LOG_FILENAME_PATTERN); fh.setFormatter(new SimpleFormatter()); //removeAllLoggersHandlers(Logger.getLogger("")); Logger.getLogger("").addHandler(fh); Logger.getLogger("").setLevel(Level.FINEST); Options options = new Options(); Option option1 = new Option("in", "ODT file (required)"); option1.setRequired(true);//from w w w. j av a 2 s . c o m option1.setArgs(1); Option option2 = new Option("out", "Output file (required)"); option2.setRequired(false); option2.setArgs(1); Option option3 = new Option("pic", "extract pics"); option3.setRequired(false); option3.setArgs(1); Option option4 = new Option("page", "enable pagination processing"); option4.setRequired(false); option4.setArgs(0); options.addOption(option1); options.addOption(option2); options.addOption(option3); options.addOption(option4); CommandLineParser parser = new BasicParser(); CommandLine cmd = null; try { cmd = parser.parse(options, args); } catch (ParseException e) { printHelp(); return; } if (cmd.hasOption("help")) { printHelp(); return; } File outFile = new File(cmd.getOptionValue("out")); OdtUtils utils = new OdtUtils(); utils.open(cmd.getOptionValue("in")); //utils.correctionStep(); utils.saveXML(outFile.getAbsolutePath()); try { if (cmd.hasOption("page")) { OdtUtils.paginationProcessing(outFile.getAbsolutePath()); } OdtUtils.correctionProcessing(outFile.getAbsolutePath()); } catch (ParserConfigurationException ex) { logger.log(Level.SEVERE, null, ex); } catch (SAXException ex) { logger.log(Level.SEVERE, null, ex); } catch (IOException ex) { logger.log(Level.SEVERE, null, ex); } catch (TransformerConfigurationException ex) { logger.log(Level.SEVERE, null, ex); } catch (TransformerException ex) { logger.log(Level.SEVERE, null, ex); } if (cmd.hasOption("pic")) { String imageDir = cmd.getOptionValue("pic"); if (!imageDir.endsWith("/")) { imageDir += "/"; } try { String basedir = new File(cmd.getOptionValue("out")).getParent().toString() + System.getProperty("file.separator"); OdtUtils.extractAndNormalizeEmbedPictures(cmd.getOptionValue("out"), cmd.getOptionValue("in"), basedir, imageDir); } catch (SAXException ex) { logger.log(Level.SEVERE, null, ex); } catch (ParserConfigurationException ex) { logger.log(Level.SEVERE, null, ex); } catch (TransformerConfigurationException ex) { logger.log(Level.SEVERE, null, ex); } catch (TransformerException ex) { logger.log(Level.SEVERE, null, ex); } } }
From source file:com.canoo.dolphin.todo.client.ToDoClient.java
public static void main(String[] args) { Logger OD_LOGGER = Logger.getLogger("org.opendolphin"); OD_LOGGER.setLevel(Level.SEVERE); Application.launch(args);//from www .j av a 2s . c om }