示例#1
0
 public void logAtMaster(Level level, String msg) {
   Address master = getMasterAddress();
   if (!isMaster() && master != null) {
     Connection connMaster = node.connectionManager.getOrConnect(getMasterAddress());
     if (connMaster != null) {
       Packet packet = obtainPacket(level.toString(), null, toData(msg), ClusterOperation.LOG, 0);
       sendOrReleasePacket(packet, connMaster);
     }
   } else {
     logger.log(level, msg);
   }
 }
示例#2
0
文件: Log.java 项目: G10DRAS/speech
 /**
  * Set the logging level using one of the words "severe", "warning" etc corresponding to logging
  * levels. This function is case insensitive.
  *
  * @param word
  */
 public static void setLevelByName(String word) {
   String s = word.toUpperCase();
   Level level = Level.SEVERE;
   if (s.equals("SEVERE")) level = Level.SEVERE;
   if (s.equals("WARNING")) level = Level.WARNING;
   if (s.equals("INFO")) level = Level.INFO;
   if (s.equals("CONFIG")) level = Level.CONFIG;
   if (s.equals("FINE")) level = Level.FINE;
   if (s.equals("FINER")) level = Level.FINER;
   if (s.equals("FINEST")) level = Level.FINEST;
   logger.setLevel(level);
   Level ll = logger.getLevel();
   System.out.println("Logging level now " + ll.toString());
 }