Example usage for java.util.logging Logger getAnonymousLogger

List of usage examples for java.util.logging Logger getAnonymousLogger

Introduction

In this page you can find the example usage for java.util.logging Logger getAnonymousLogger.

Prototype

public static Logger getAnonymousLogger() 

Source Link

Document

Create an anonymous Logger.

Usage

From source file:Main.java

public static void main(String args[]) {
    Logger log = Logger.getAnonymousLogger();
    setLoggerhandler(log);//from  ww  w .  j a  v a 2  s.  c  om

    log.finest(new Exception().toString());
}

From source file:drpc.BptiEnsembleQuery.java

public static void main(final String[] args) throws IOException, TException, DRPCExecutionException {
    if (args.length < 3) {
        System.err.println("Where are the arguments? args -- DrpcServer DrpcFunctionName folder");
        return;//from ww  w  . java 2s .  c o  m
    }

    final DRPCClient client = new DRPCClient(args[0], 3772, 1000000 /*timeout*/);
    final Queue<String> featureFiles = new ArrayDeque<String>();
    SpoutUtils.listFilesForFolder(new File(args[2]), featureFiles);

    Scanner scanner = new Scanner(featureFiles.peek());
    int i = 0;
    while (scanner.hasNextLine() && i++ < 1) {
        List<Map<String, List<Double>>> dict = SpoutUtils.pythonDictToJava(scanner.nextLine());
        for (Map<String, List<Double>> map : dict) {
            final Double[] features = map.get("chi1").toArray(new Double[0]);
            final Double[] moreFeatures = map.get("chi2").toArray(new Double[0]);
            final Double[] both = (Double[]) ArrayUtils.addAll(features, moreFeatures);
            final String parameters = serializeFeatureVector(ArrayUtils.toPrimitive(both));
            Logger.getAnonymousLogger().log(Level.INFO, runQuery(args[1], parameters, client));
        }
    }
    client.close();
}

From source file:au.com.addstar.SpigotUpdater.java

public static void main(String[] args) {
    Configuration config = new Configuration();
    final boolean check = !(args.length >= 1 && args[0].equals("--check"));
    if (check) {/*  w  ww. j ava 2s.  com*/
        System.out.println(" ONLY CHECKING NO DOWNLOADS WILL BE PERFORMED.");
    } else {
        System.out.println(" Preparing Plugins .... ");
    }
    downloadDir = config.downloadDir;
    if (!downloadDir.exists()) {
        downloadDir.mkdir();
    }
    List<String> search = new ArrayList<>();
    if (args.length > 1) {
        int i = 0;
        for (String arg : args) {
            if (i > 0) {
                search.add(arg);
            }
            i++;
        }
    }
    datFile = new File(downloadDir, "plugins.dat");
    externalDownloads = config.externalDownloads;
    loadPlugins(search);
    spigotDownloader = new SpigotDirectDownloader(config);
    doOutHeader(plugins);
    for (final Plugin p : plugins) {
        SpigetUpdater updater = new SpigetUpdater(p.getVersion(), Logger.getAnonymousLogger(),
                p.getResourceID(), config);
        updater.setExternal(externalDownloads);
        updater.checkForUpdate(getUpdateCallBack(updater, p, check));
    }
    /*try {
    savePlugins();
    }catch (IOException e){
    e.printStackTrace();
    }*/
    System.out.println("Processed:  " + plugins.size() + " plugins");
}

From source file:com.github.badoualy.badoualyve.BadOuAlyveApplication.java

public static void main(String[] args) {
    SpringApplication.run(BadOuAlyveApplication.class, args);
    Logger.getAnonymousLogger().info("SERVER LAUNCHED");
}

From source file:com.brainflow.application.toplevel.Brainflow.java

public static void main(String[] args) {

    final Brainflow bflow = getInstance();

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            try {
                log.info("Launching Brainflow ...");
                bflow.launch();/*w  w w. jav  a2 s. com*/
            } catch (Throwable e) {
                Logger.getAnonymousLogger().severe("Error Launching Brainflow, exiting");
                e.printStackTrace();
                System.exit(-1);

            }

        }
    });

}

From source file:brainflow.app.toplevel.BrainFlow.java

public static void main(String[] args) {

    final BrainFlow bflow = get();

    //Class myClass = BrainFlow.class;
    //URL url = myClass.getResource("BrainFlow.class");
    //System.out.println("class located: " + url);

    SwingUtilities.invokeLater(new Runnable() {
        public void run() {
            try {
                log.info("Launching BrainFlow ...");
                bflow.launch();//from  w w w  .  ja  v  a 2 s.c  o m
            } catch (Throwable e) {
                Logger.getAnonymousLogger().severe("Error Launching BrainFlow, exiting");
                e.printStackTrace();
                System.exit(-1);

            }

        }
    });

}

From source file:net.itransformers.topologyviewer.fulfilmentfactory.impl.TestFulfilmentImpl.java

public static void main(String[] args) throws IOException {
    TelnetCLIInterface cli1 = new TelnetCLIInterface("10.10.10.10", "user", "pass!", "hostname#", 1000,
            Logger.getAnonymousLogger());
    cli1.open();/*w  w  w .  j a v a  2  s  . c  om*/
    TestFulfilmentImpl ful = new TestFulfilmentImpl(cli1);
    Map<String, String> params = new HashMap<String, String>();
    params.put("username", "user");
    params.put("password", "pass!");
    params.put("site", "hostname");
    ful.execute("fulfilment-factory/conf/txt/configureInterface.txt", params);
    cli1.close();
}

From source file:Main.java

public static String readPeopleData(String uri) {
    URL url;/*from  w  w  w .j  a  v  a2s.c o  m*/
    StringBuffer jsonstring = null;
    HttpURLConnection connection;

    Logger.getAnonymousLogger().info("Getting data for " + uri);

    try {
        url = new URL(uri);
        connection = (HttpURLConnection) url.openConnection();
        connection.setConnectTimeout(1000 * 5);

        InputStreamReader is = new InputStreamReader(connection.getInputStream());
        BufferedReader buff = new BufferedReader(is);
        jsonstring = new StringBuffer();
        String line = "";
        do {
            line = buff.readLine();
            if (line != null)
                jsonstring.append(line);
        } while (line != null);
    }

    catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

    Logger.getAnonymousLogger().info("Returning Data " + jsonstring);

    if (null != jsonstring) {
        return jsonstring.toString().trim();
    } else {
        return null;
    }
}

From source file:mockit.integration.logging.MoreLoggingIntegrationsTest.java

@Test
public void jdkLoggingShouldLogNothing() {
    Logger log1 = Logger.getAnonymousLogger();

    log1.entering("testing that logger does nothing", "method");
    log1.exiting("testing that logger does nothing", "method", new Object());
}

From source file:com.tckb.geo.stubgen.Generator.java

/**
 * Generates the java stubs for the POJOs used for REST web service
 *///from  w  w w. java2 s  .c  o  m
public static void generateStubs() {
    if (new File(outDir).mkdir()) {
        try {
            getRawJsonFromRemote();
            Logger.getAnonymousLogger().info("Generating stubs...");

            JCodeModel model = new JCodeModel();
            SchemaMapper mapper = new SchemaMapper(new RuleFactory(new DefaultGenerationConfig() {
                @Override
                public SourceType getSourceType() {
                    return SourceType.JSON;
                }

                @Override
                public boolean isUseCommonsLang3() {
                    return false;
                }

                @Override
                public boolean isIncludeHashcodeAndEquals() {
                    return false;
                }

                @Override
                public boolean isIncludeToString() {
                    return false;
                }

                @Override
                public boolean isIncludeJsr303Annotations() {
                    return false;
                }

            }, new NoopAnnotator(), new SchemaStore()), new SchemaGenerator());

            mapper.generate(model, "Device", "com.tckb.geo.stubs", new URL("file://" + deviceJson));
            model.build(new File(outDir));
            mapper.generate(model, "Cluster", "com.tckb.geo.stubs", new URL("file://" + clusterJson));
            model.build(new File(outDir));

        } catch (IOException ex) {

            Logger.getAnonymousLogger().log(Level.SEVERE, "Failed ! {0}", ex.getLocalizedMessage());
        }
        Logger.getAnonymousLogger().info("Finished");

    } else {
        Logger.getAnonymousLogger().severe("Cannot create output directory!");

    }

}