org.jboss.logmanager.Logger.log()方法的使用及代码示例

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

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

Logger.log介绍

[英]SPI interface method to log a message at a given level, with a specific resource bundle.
[中]SPI接口方法,使用特定的资源包在给定级别记录消息。

代码示例

代码示例来源:origin: wildfly/wildfly

  1. protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) {
  2. java.util.logging.Level translatedLevel = translate(level);
  3. if (logger.isLoggable(translatedLevel)) {
  4. if (parameters == null) {
  5. logger.log(loggerClassName, translatedLevel, String.valueOf(message), thrown);
  6. } else {
  7. logger.log(loggerClassName, translatedLevel, String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, parameters, thrown);
  8. }
  9. }
  10. }

代码示例来源:origin: wildfly/wildfly

  1. protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) {
  2. if (parameters == null) {
  3. logger.log(loggerClassName, translate(level), format, thrown);
  4. } else {
  5. logger.log(loggerClassName, translate(level), format, ExtLogRecord.FormatStyle.PRINTF, parameters, thrown);
  6. }
  7. }

代码示例来源:origin: org.jboss.logmanager/jboss-logmanager

  1. /**
  2. * SPI interface method to log a message at a given level.
  3. *
  4. * @param fqcn the fully qualified class name of the first logger class
  5. * @param level the level to log at
  6. * @param message the message
  7. * @param t the throwable, if any
  8. */
  9. public void log(final String fqcn, final Level level, final String message, final Throwable t) {
  10. log(fqcn, level, message, ExtLogRecord.FormatStyle.MESSAGE_FORMAT, null, t);
  11. }

代码示例来源:origin: org.jboss.logmanager/jboss-logmanager

  1. /**
  2. * Method invoked when the given thread terminates due to the given uncaught exception. <p>Any exception thrown by this
  3. * method will be ignored by the Java Virtual Machine.
  4. *
  5. * @param t the thread
  6. * @param e the exception
  7. */
  8. public void uncaughtException(final Thread t, final Throwable e) {
  9. log.log(Level.ERROR, "Uncaught exception", e);
  10. }
  11. }

代码示例来源:origin: org.jboss.logging/jboss-logging-logmanager

  1. public void logf(final org.jboss.logging.Logger.Level level, final String loggerFqcn, final String format, final Object[] params, final Throwable t) {
  2. if (params == null) {
  3. logger.log(loggerFqcn, LEVELS.get(level), format, t);
  4. } else {
  5. logger.log(loggerFqcn, LEVELS.get(level), format, ExtLogRecord.FormatStyle.PRINTF, params, t);
  6. }
  7. }
  8. }

代码示例来源:origin: org.jboss.logging/jboss-logging-logmanager

  1. public void log(final org.jboss.logging.Logger.Level level, final String loggerFqcn, final Object message, final Object[] params, final Throwable t) {
  2. if (params == null) {
  3. logger.log(loggerFqcn, LEVELS.get(level), String.valueOf(message), t);
  4. } else {
  5. logger.log(loggerFqcn, LEVELS.get(level), String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, params, t);
  6. }
  7. }

代码示例来源:origin: org.jboss.logmanager/jboss-logmanager

  1. private static void safeFlush(Handler handler) {
  2. try {
  3. if (handler != null) handler.flush();
  4. } catch (Throwable t) {
  5. // todo - might this loop somehow?
  6. log.log(Level.ERROR, "Error flushing a log handler", t);
  7. }
  8. }

代码示例来源:origin: weld/core

  1. protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) {
  2. java.util.logging.Level translatedLevel = translate(level);
  3. if (logger.isLoggable(translatedLevel)) {
  4. if (parameters == null) {
  5. logger.log(loggerClassName, translatedLevel, String.valueOf(message), thrown);
  6. } else {
  7. logger.log(loggerClassName, translatedLevel, String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, parameters, thrown);
  8. }
  9. }
  10. }

代码示例来源:origin: weld/core

  1. protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) {
  2. if (parameters == null) {
  3. logger.log(loggerClassName, translate(level), format, thrown);
  4. } else {
  5. logger.log(loggerClassName, translate(level), format, ExtLogRecord.FormatStyle.PRINTF, parameters, thrown);
  6. }
  7. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) {
  2. java.util.logging.Level translatedLevel = translate(level);
  3. if (logger.isLoggable(translatedLevel)) {
  4. if (parameters == null) {
  5. logger.log(loggerClassName, translatedLevel, String.valueOf(message), thrown);
  6. } else {
  7. logger.log(loggerClassName, translatedLevel, String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, parameters, thrown);
  8. }
  9. }
  10. }

代码示例来源:origin: org.jboss.seam.solder/seam-solder

  1. protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) {
  2. if (parameters == null) {
  3. logger.log(loggerClassName, translate(level), format, thrown);
  4. } else {
  5. logger.log(loggerClassName, translate(level), format, ExtLogRecord.FormatStyle.PRINTF, parameters, thrown);
  6. }
  7. }

代码示例来源:origin: org.jboss.logging/com.springsource.org.jboss.logging

  1. protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) {
  2. if (parameters == null) {
  3. logger.log(loggerClassName, translate(level), String.valueOf(message), thrown);
  4. } else {
  5. logger.log(loggerClassName, translate(level), String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, parameters, thrown);
  6. }
  7. }

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

  1. protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) {
  2. if (parameters == null) {
  3. logger.log(loggerClassName, translate(level), format, thrown);
  4. } else {
  5. logger.log(loggerClassName, translate(level), format, ExtLogRecord.FormatStyle.PRINTF, parameters, thrown);
  6. }
  7. }

代码示例来源:origin: org.jboss.eap/wildfly-client-all

  1. protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) {
  2. if (parameters == null) {
  3. logger.log(loggerClassName, translate(level), format, thrown);
  4. } else {
  5. logger.log(loggerClassName, translate(level), format, ExtLogRecord.FormatStyle.PRINTF, parameters, thrown);
  6. }
  7. }

代码示例来源:origin: org.jboss.weld.servlet/weld-servlet-shaded

  1. protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) {
  2. java.util.logging.Level translatedLevel = translate(level);
  3. if (logger.isLoggable(translatedLevel)) {
  4. if (parameters == null) {
  5. logger.log(loggerClassName, translatedLevel, String.valueOf(message), thrown);
  6. } else {
  7. logger.log(loggerClassName, translatedLevel, String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, parameters, thrown);
  8. }
  9. }
  10. }

代码示例来源:origin: org.jboss.logmanager/jboss-logmanager

  1. private static void safeClose(Handler handler) {
  2. try {
  3. if (handler != null) handler.close();
  4. } catch (Throwable t) {
  5. // todo - might this loop somehow?
  6. log.log(Level.ERROR, "Error closing a log handler", t);
  7. }
  8. }

代码示例来源:origin: org.jboss.weld.se/weld-se

  1. protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) {
  2. java.util.logging.Level translatedLevel = translate(level);
  3. if (logger.isLoggable(translatedLevel)) {
  4. if (parameters == null) {
  5. logger.log(loggerClassName, translatedLevel, String.valueOf(message), thrown);
  6. } else {
  7. logger.log(loggerClassName, translatedLevel, String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, parameters, thrown);
  8. }
  9. }
  10. }

代码示例来源:origin: org.jboss.weld.se/weld-se

  1. protected void doLogf(final Level level, final String loggerClassName, final String format, final Object[] parameters, final Throwable thrown) {
  2. if (parameters == null) {
  3. logger.log(loggerClassName, translate(level), format, thrown);
  4. } else {
  5. logger.log(loggerClassName, translate(level), format, ExtLogRecord.FormatStyle.PRINTF, parameters, thrown);
  6. }
  7. }

代码示例来源:origin: org.jboss.weld.se/weld-se-shaded

  1. protected void doLog(final Level level, final String loggerClassName, final Object message, final Object[] parameters, final Throwable thrown) {
  2. java.util.logging.Level translatedLevel = translate(level);
  3. if (logger.isLoggable(translatedLevel)) {
  4. if (parameters == null) {
  5. logger.log(loggerClassName, translatedLevel, String.valueOf(message), thrown);
  6. } else {
  7. logger.log(loggerClassName, translatedLevel, String.valueOf(message), ExtLogRecord.FormatStyle.MESSAGE_FORMAT, parameters, thrown);
  8. }
  9. }
  10. }

代码示例来源:origin: org.jboss.logmanager/commons-logging-jboss-logmanager

  1. private void log(final Level level, final Object message, final Throwable t) {
  2. final String msg = String.valueOf(message);
  3. final ExtLogRecord record = new ExtLogRecord(level, msg, LOGGER_CLASS_NAME);
  4. record.setThrown(t);
  5. delegate.log(record);
  6. }

相关文章