Example usage for java.util.logging Logger getLogger

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

Introduction

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

Prototype




@CallerSensitive
public static Logger getLogger(String name) 

Source Link

Document

Find or create a logger for a named subsystem.

Usage

From source file:com.ontologycentral.ldspider.LDSpider_LogUtil.java

public static void setDefaultLogging() {
    Logger.getLogger("").setLevel(Level.WARNING);
    // Suppress silly cookie warnings.
    Logger.getLogger("org.apache.commons.httpclient").setLevel(Level.SEVERE);
    Logger.getLogger("").getHandlers()[0].setLevel(Level.ALL);
}

From source file:de.quadrillenschule.azocamsynca.helpers.Formats.java

public static long toLong(String time) {
    SimpleDateFormat sdf = new SimpleDateFormat(DF);
    long retval = 0;
    try {//from  w w  w  .j a v  a2  s. c  o  m
        retval = sdf.parse(time).getTime() - sdf.parse("0:00:00").getTime();
    } catch (ParseException ex) {
        Logger.getLogger(Formats.class.getName()).log(Level.SEVERE, null, ex);
        return 0;
    }
    return retval;
}

From source file:com.enseval.ttss.util.Util.java

public static Date toDate(String tgl) {
    Date ret = null;//from w ww. j av a 2s . c o m
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");

    try {
        ret = formatter.parse(tgl);
    } catch (ParseException ex) {
        Logger.getLogger(Util.class.getName()).log(Level.SEVERE, null, ex);
    }

    return ret;
}

From source file:util.JSPUtil.java

public static void naytaJSP(HttpServletRequest request, HttpServletResponse response, String jspsivu) {
    RequestDispatcher dispatcher = null;
    //dispatcher = request.getRequestDispatcher("WEB-INF/jsp/muokkaatankki.jsp");
    dispatcher = request.getRequestDispatcher(jspsivu);
    try {//from   w w  w.  ja v  a 2s  .  c  om
        dispatcher.forward(request, response);
    } catch (ServletException ex) {
        Logger.getLogger(JSPUtil.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(JSPUtil.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:com.kamike.misc.MiscDateUtils.java

public static Date getDate(String value) {

    if ("".endsWith(value) || value == null) {
        return new Date(System.currentTimeMillis());
    }// w w w.  j a  va  2s  .c  o  m
    try {
        return DateUtils.parseDate(value, DATE_PATTERN);

    } catch (ParseException ex) {
        Logger.getLogger(MiscDateUtils.class.getName()).log(Level.SEVERE, null, ex);
        return new Date(System.currentTimeMillis());
    }
}

From source file:sandeep.kb.android.remote.utils.Utils.java

public static void sleep(long millis) {
    try {/*from   w w  w.j av a 2 s  .co  m*/
        Thread.sleep(millis);
    } catch (InterruptedException ex) {
        Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:api.behindTheName.NameReader.java

static HashMap<String, String> load() {
    HashMap<String, String> data = new HashMap<>();

    File file = new File("options.txt");

    try {//www . j a  v a2s  . c  om
        List<String> lines = FileUtils.readLines(file);
        for (String s : lines) {
            if (s.contains("#"))
                continue;
            String htk = s.split("\\s")[0];
            String cntry = s.substring(htk.length() + 1);
            data.put(cntry, htk);
        }
    } catch (IOException ex) {
        Logger.getLogger(NameReader.class.getName()).log(Level.SEVERE, null, ex);
    }

    return data;

}

From source file:dk.sdu.mmmi.hwr.group2.Utils.java

public static Match getMatch(int matchID) {
    JSONObject json;//from  w  w w  .  j  a  va  2  s . co m
    String readURL = null;
    try {
        readURL = readURL("http://178.62.164.18:8080/foosball/api/match/get/" + matchID);
        json = new JSONObject(readURL);
    } catch (IOException ex) {
        Logger.getLogger(Utils.class.getName()).log(Level.SEVERE, null, ex);
        return null;
    }

    JSONArray matches = json.getJSONArray("matches");
    JSONObject matchJSON = matches.getJSONObject(0);

    Match match = new Match(matchJSON.getInt("id"), matchJSON.getInt("startTime") * 1000l);
    JSONArray goalsJSON = matchJSON.getJSONArray("goals");

    for (int i = 0; i < goalsJSON.length(); i++) {
        JSONObject goal = goalsJSON.getJSONObject(i);
        int player = goal.getInt("player");
        int time = goal.getInt("time");
        match.addGoal(player, time * 1000l);
    }
    return match;
}

From source file:ju.ehealthservice.utils.ImageHandler.java

public static byte[] getBinData(String fileName) {
    try {//from w  w  w. j  a  va2 s.  c o  m
        File f = new File(fileName);
        byte[] bin = FileUtils.readFileToByteArray(f);
        return bin;
    } catch (FileNotFoundException ex) {
        Logger.getLogger(GetGraphImages.class.getName()).log(Level.SEVERE, null, ex);
    } catch (IOException ex) {
        Logger.getLogger(GetGraphImages.class.getName()).log(Level.SEVERE, null, ex);
    }
    return null;
}

From source file:Main.java

/**
 * Tells Java's Logging infrastructure to output whatever it possibly can, this is only needed
 * in Java, not in Android.//from w  w w .  j  a va2s  .  c o  m
 */
public static void outputAsMuchLoggingAsPossible() {
    Logger log = Logger.getLogger("com.couchbase.lite");
    ConsoleHandler handler = new ConsoleHandler();
    handler.setLevel(Level.ALL);
    log.addHandler(handler);
    log.setLevel(Level.ALL);
}