de.mhus.lib.core.logging.Log.w()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中de.mhus.lib.core.logging.Log.w()方法的一些代码示例,展示了Log.w()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Log.w()方法的具体详情如下:
包路径:de.mhus.lib.core.logging.Log
类名称:Log
方法名:w

Log.w介绍

[英]Log a message in warn, it will automatically append the objects if debug is enabled. Can Also add a trace.
[中]在警告中记录一条消息,如果启用了调试,它将自动附加对象。还可以添加跟踪。

代码示例

代码示例来源:origin: de.mhus.lib/mhu-lib-core

public static void logStackTrace(Log log, String prefix, StackTraceElement[] stackTrace) {
  for (StackTraceElement element : stackTrace) {
    log.w(prefix,"  " + element);
  }
  
}

代码示例来源:origin: de.mhus.lib/mhu-lib-core

public static String sha256(String text) {
  try {
    MessageDigest digest = MessageDigest.getInstance("SHA-256");
    byte[] hash = digest.digest(text.getBytes(StandardCharsets.UTF_8));
    return Base64.getEncoder().encodeToString(hash);
  } catch (NoSuchAlgorithmException e) {
    log.w(e);
  }
  return null;
}

代码示例来源:origin: de.mhus.lib/mhu-lib-core

public static String md5(String real) {
  MessageDigest md;
  try {
    md = MessageDigest.getInstance("MD5");
    md.update(real.getBytes());
    return MCast.toBinaryString(md.digest());
  } catch (NoSuchAlgorithmException e) {
    log.w(e);
  }
  return null;
}

代码示例来源:origin: de.mhus.lib/mhu-lib-persistence

public void log(Log log) {
  log.w(id,"Connection",this);
  MLogUtil.logStackTrace(log, ""+id, stackTrace);
}

代码示例来源:origin: de.mhus.lib/mhu-lib-persistence

public void clear() {
  synchronized (connections) {
    for (TransactionConnection con : connections.values())
      try {
        con.close();
      } catch (Throwable e) {
        MLogUtil.log().w(e);
      }
    connections.clear();
  }
}

代码示例来源:origin: de.mhus.lib/mhu-lib-persistence

public boolean rollback() {
  boolean success = true;
  synchronized (connections) {
    for (TransactionConnection con : connections.values())
      try {
        con.rollback();
      } catch (Throwable e) {
        success = false;
        MLogUtil.log().w(e);
      }
  }
  return success;
}

代码示例来源:origin: de.mhus.lib/mhu-lib-persistence

public boolean commit() {
  boolean success = true;
  synchronized (connections) {
    for (TransactionConnection con : connections.values())
      try {
        con.commit();
      } catch (Throwable e) {
        success = false;
        MLogUtil.log().w(e);
      }
  }
  return success;
}

代码示例来源:origin: de.mhus.lib/mhu-lib-forms

/** {@inheritDoc} */
@Override
public void update(Observable o, Object arg) {
  if (ui != null)
    try {
      ui.doUpdate((DataConnector)o);
    } catch (MException e) {
      log().w(e);
    }
}

代码示例来源:origin: de.mhus.lib/mhu-lib-karaf

@Override
public List<JmsConnection> getConnections() {
  LinkedList<JmsConnection> out = new LinkedList<>();
  for (JmsDataSource obj : MOsgi.getServices(JmsDataSource.class, null))
    try {
      out.add(obj.getConnection());
    } catch (JMSException e) {
      log().w(e);
    }
  return out;
}

代码示例来源:origin: de.mhus.lib/mhu-lib-karaf

protected DataSource getDataSource() {
  DataSource ds = util.getDataSource(dataSourceName);
  if (ds == null)
    log().w("DataSource is unknown",dataSourceName);
  return ds;
}

代码示例来源:origin: de.mhus.lib/mhu-lib-jms

@Override
public void onException(JMSException exception) {
  log().w("kill connection",connection,exception);
  reset();
}

代码示例来源:origin: de.mhus.lib/mhu-lib-core

protected void loadEntry(File file) throws IOException {
  FileInputStream parent = new FileInputStream(file);
  InputStream is = MCrypt.createCipherInputStream(parent, passphrase.value());
  ObjectInputStream ois = new ObjectInputStream(is);
  try {
    VaultEntry entry = new FileEntry(version,ois);
    addEntry(entry);
  } catch (Exception e) {
    log().w(file,e);
  }
  parent.close();
}

代码示例来源:origin: de.mhus.lib/mhu-lib-karaf

public void removeConnection(String name) {
  if (name == null) return;
  log().d("remove connection",name);
  connectionNames.remove(name);
  for ( JmsDataChannel c : new LinkedList<JmsDataChannel>(channels.values()))
    if (name.equals(c.getConnectionName()))
      try {
        c.onDisconnect();
      } catch (Throwable t) {
        log().w(name,c,t);
      }
}

代码示例来源:origin: de.mhus.lib/mhu-lib-karaf

public void addConnection(String name, JmsConnection connection) {
  if (name == null) return;
  log().d("add connection",name);
  connectionNames.add(name);
  for ( JmsDataChannel c : new LinkedList<JmsDataChannel>(channels.values()))
    if (name.equals(c.getConnectionName()))
      try {
        c.onConnect();
      } catch (Throwable t) {
        log().w(name,c,t);
      }
}

代码示例来源:origin: de.mhus.lib/mhu-lib-core

public FileWatch doStart() {
  if (started) return this;
  started = true; // do not need sync...
  
  if (!file.exists())
    log().w("file not found",file);
  if (startHook) checkFile(); // init
  if (!registered) {
    MHousekeeper housekeeper = MApi.lookup(MHousekeeper.class);
    housekeeper.register(this, period);
    registered = true;
  }
  return this;
}

代码示例来源:origin: de.mhus.lib/mhu-lib-karaf

@Override
public void resetConnection(String name) {
  if (name == null) return;
  log().d("reset connection",name);
  for ( JmsDataChannel c : new LinkedList<JmsDataChannel>(channels.values()))
    if (name.equals(c.getConnectionName()))
      try {
        c.onDisconnect();
      } catch (Throwable t) {
        log().w(name,c,t);
      }
}

代码示例来源:origin: de.mhus.lib/mhu-lib-vaadin

protected VaadinPojoForm<E> createForm() {
  try {
    VaadinPojoForm<E> form = new VaadinPojoForm<>(createTarget());
    form.setPojo(createTarget());
    return form;
  } catch (Throwable t) {
    log.w(t);
  }
  return null;
}

代码示例来源:origin: de.mhus.lib/mhu-lib-persistence

@Override
protected void doUpdate(MProperties modified) {
  if (!isEditable()) throw new AccessDeniedException(file);
  File metaFile = ((FsCore)core).getMetaFileFor(file);
  modified.remove("id");
  try {
    modified.save(metaFile);
  } catch (IOException e) {
    log().w(metaFile,e);
  }
  reload();
}

代码示例来源:origin: de.mhus.lib/mhu-lib-vaadin6

@Override
  public void createCompositStop(LayoutComposite composite) {
    try {
      log().i("createCompositStop", composite.getConfig().getName());
    } catch (MException e) {
      log().w(e);
    }

    UiElement ui = composite.getUi();
    if (ui != null) {
      if ( ((UiVaadinComposite)ui).isTransparent()) return;
    }
//        if (composite.getConfig().getName().equals("split")) return;
    
    pop();
  }

代码示例来源:origin: de.mhus.cherry.reactive/reactive-util

@Override
public void doExecuteActivity() throws Exception {
  EElement eNode = getContext().getENode();
  for (Output output : eNode.getActivityDescription().outputs()) {
    try {
      getContext().createActivity(output.activity());
    } catch (Throwable t) {
      log().w(output,t);
    }
  }
  getContext().getPNode().setState(STATE_NODE.CLOSED);
}

相关文章