io.airlift.log.Logger.illegalFormatMessageFor()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(243)

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

Logger.illegalFormatMessageFor介绍

暂无

代码示例

代码示例来源:origin: com.teradata.airlift/log

  1. /**
  2. * Logs a message at WARN level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.warn(e, "something bad happened when connecting to %s:%d", host, port);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param exception an exception associated with the warning being logged
  12. * @param format a format string compatible with String.format()
  13. * @param args arguments for the format string
  14. */
  15. public void warn(Throwable exception, String format, Object... args)
  16. {
  17. if (logger.isLoggable(WARNING)) {
  18. String message;
  19. try {
  20. message = format(format, args);
  21. }
  22. catch (IllegalFormatException e) {
  23. logger.log(SEVERE, illegalFormatMessageFor("WARN", format, args), e);
  24. message = rawMessageFor(format, args);
  25. }
  26. logger.log(WARNING, message, exception);
  27. }
  28. }

代码示例来源:origin: io.airlift/log

  1. /**
  2. * Logs a message at DEBUG level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.debug("value is %s (%d ms)", value, time);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param format a format string compatible with String.format()
  12. * @param args arguments for the format string
  13. */
  14. public void debug(String format, Object... args)
  15. {
  16. if (logger.isLoggable(FINE)) {
  17. String message;
  18. try {
  19. message = format(format, args);
  20. }
  21. catch (IllegalFormatException e) {
  22. logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
  23. message = rawMessageFor(format, args);
  24. }
  25. logger.fine(message);
  26. }
  27. }

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

  1. /**
  2. * Logs a message at DEBUG level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.debug("value is %s (%d ms)", value, time);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param format a format string compatible with String.format()
  12. * @param args arguments for the format string
  13. */
  14. public void debug(String format, Object... args)
  15. {
  16. if (logger.isLoggable(FINE)) {
  17. String message;
  18. try {
  19. message = format(format, args);
  20. }
  21. catch (IllegalFormatException e) {
  22. logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
  23. message = rawMessageFor(format, args);
  24. }
  25. logger.fine(message);
  26. }
  27. }

代码示例来源:origin: io.airlift/log

  1. /**
  2. * Logs a message at INFO level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.info("value is %s (%d ms)", value, time);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param format a format string compatible with String.format()
  12. * @param args arguments for the format string
  13. */
  14. public void info(String format, Object... args)
  15. {
  16. if (logger.isLoggable(INFO)) {
  17. String message;
  18. try {
  19. message = format(format, args);
  20. }
  21. catch (IllegalFormatException e) {
  22. logger.log(SEVERE, illegalFormatMessageFor("INFO", format, args), e);
  23. message = rawMessageFor(format, args);
  24. }
  25. logger.info(message);
  26. }
  27. }

代码示例来源:origin: com.teradata.airlift/log

  1. /**
  2. * Logs a message at DEBUG level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.debug("value is %s (%d ms)", value, time);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param format a format string compatible with String.format()
  12. * @param args arguments for the format string
  13. */
  14. public void debug(String format, Object... args)
  15. {
  16. if (logger.isLoggable(FINE)) {
  17. String message;
  18. try {
  19. message = format(format, args);
  20. }
  21. catch (IllegalFormatException e) {
  22. logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
  23. message = rawMessageFor(format, args);
  24. }
  25. logger.fine(message);
  26. }
  27. }

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

  1. /**
  2. * Logs a message at DEBUG level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.debug(e, "value is %s (%d ms)", value, time);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param exception an exception associated with the debug message being logged
  12. * @param format a format string compatible with String.format()
  13. * @param args arguments for the format string
  14. */
  15. public void debug(Throwable exception, String format, Object... args)
  16. {
  17. if (logger.isLoggable(FINE)) {
  18. String message;
  19. try {
  20. message = format(format, args);
  21. }
  22. catch (IllegalFormatException e) {
  23. logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
  24. message = rawMessageFor(format, args);
  25. }
  26. logger.log(FINE, message, exception);
  27. }
  28. }

代码示例来源:origin: io.airlift/log

  1. /**
  2. * Logs a message at DEBUG level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.debug(e, "value is %s (%d ms)", value, time);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param exception an exception associated with the debug message being logged
  12. * @param format a format string compatible with String.format()
  13. * @param args arguments for the format string
  14. */
  15. public void debug(Throwable exception, String format, Object... args)
  16. {
  17. if (logger.isLoggable(FINE)) {
  18. String message;
  19. try {
  20. message = format(format, args);
  21. }
  22. catch (IllegalFormatException e) {
  23. logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
  24. message = rawMessageFor(format, args);
  25. }
  26. logger.log(FINE, message, exception);
  27. }
  28. }

代码示例来源:origin: com.teradata.airlift/log

  1. /**
  2. * Logs a message at INFO level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.info("value is %s (%d ms)", value, time);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param format a format string compatible with String.format()
  12. * @param args arguments for the format string
  13. */
  14. public void info(String format, Object... args)
  15. {
  16. if (logger.isLoggable(INFO)) {
  17. String message;
  18. try {
  19. message = format(format, args);
  20. }
  21. catch (IllegalFormatException e) {
  22. logger.log(SEVERE, illegalFormatMessageFor("INFO", format, args), e);
  23. message = rawMessageFor(format, args);
  24. }
  25. logger.info(message);
  26. }
  27. }

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

  1. /**
  2. * Logs a message at ERROR level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.error(e, "something really bad happened when connecting to %s:%d", host, port);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param exception an exception associated with the error being logged
  12. * @param format a format string compatible with String.format()
  13. * @param args arguments for the format string
  14. */
  15. public void error(Throwable exception, String format, Object... args)
  16. {
  17. if (logger.isLoggable(SEVERE)) {
  18. String message;
  19. try {
  20. message = format(format, args);
  21. }
  22. catch (IllegalFormatException e) {
  23. logger.log(SEVERE, illegalFormatMessageFor("ERROR", format, args), e);
  24. message = rawMessageFor(format, args);
  25. }
  26. logger.log(SEVERE, message, exception);
  27. }
  28. }

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

  1. /**
  2. * Logs a message at INFO level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.info("value is %s (%d ms)", value, time);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param format a format string compatible with String.format()
  12. * @param args arguments for the format string
  13. */
  14. public void info(String format, Object... args)
  15. {
  16. if (logger.isLoggable(INFO)) {
  17. String message;
  18. try {
  19. message = format(format, args);
  20. }
  21. catch (IllegalFormatException e) {
  22. logger.log(SEVERE, illegalFormatMessageFor("INFO", format, args), e);
  23. message = rawMessageFor(format, args);
  24. }
  25. logger.info(message);
  26. }
  27. }

代码示例来源:origin: com.teradata.airlift/log

  1. /**
  2. * Logs a message at DEBUG level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.debug(e, "value is %s (%d ms)", value, time);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param exception an exception associated with the debug message being logged
  12. * @param format a format string compatible with String.format()
  13. * @param args arguments for the format string
  14. */
  15. public void debug(Throwable exception, String format, Object... args)
  16. {
  17. if (logger.isLoggable(FINE)) {
  18. String message;
  19. try {
  20. message = format(format, args);
  21. }
  22. catch (IllegalFormatException e) {
  23. logger.log(SEVERE, illegalFormatMessageFor("DEBUG", format, args), e);
  24. message = rawMessageFor(format, args);
  25. }
  26. logger.log(FINE, message, exception);
  27. }
  28. }

代码示例来源:origin: com.teradata.airlift/log

  1. /**
  2. * Logs a message at ERROR level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.error(e, "something really bad happened when connecting to %s:%d", host, port);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param exception an exception associated with the error being logged
  12. * @param format a format string compatible with String.format()
  13. * @param args arguments for the format string
  14. */
  15. public void error(Throwable exception, String format, Object... args)
  16. {
  17. if (logger.isLoggable(SEVERE)) {
  18. String message;
  19. try {
  20. message = format(format, args);
  21. }
  22. catch (IllegalFormatException e) {
  23. logger.log(SEVERE, illegalFormatMessageFor("ERROR", format, args), e);
  24. message = rawMessageFor(format, args);
  25. }
  26. logger.log(SEVERE, message, exception);
  27. }
  28. }

代码示例来源:origin: io.airlift/log

  1. /**
  2. * Logs a message at WARN level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.warn(e, "something bad happened when connecting to %s:%d", host, port);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param exception an exception associated with the warning being logged
  12. * @param format a format string compatible with String.format()
  13. * @param args arguments for the format string
  14. */
  15. public void warn(Throwable exception, String format, Object... args)
  16. {
  17. if (logger.isLoggable(WARNING)) {
  18. String message;
  19. try {
  20. message = format(format, args);
  21. }
  22. catch (IllegalFormatException e) {
  23. logger.log(SEVERE, illegalFormatMessageFor("WARN", format, args), e);
  24. message = rawMessageFor(format, args);
  25. }
  26. logger.log(WARNING, message, exception);
  27. }
  28. }

代码示例来源:origin: io.airlift/log

  1. /**
  2. * Logs a message at ERROR level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.error(e, "something really bad happened when connecting to %s:%d", host, port);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param exception an exception associated with the error being logged
  12. * @param format a format string compatible with String.format()
  13. * @param args arguments for the format string
  14. */
  15. public void error(Throwable exception, String format, Object... args)
  16. {
  17. if (logger.isLoggable(SEVERE)) {
  18. String message;
  19. try {
  20. message = format(format, args);
  21. }
  22. catch (IllegalFormatException e) {
  23. logger.log(SEVERE, illegalFormatMessageFor("ERROR", format, args), e);
  24. message = rawMessageFor(format, args);
  25. }
  26. logger.log(SEVERE, message, exception);
  27. }
  28. }

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

  1. /**
  2. * Logs a message at WARN level.
  3. * <p>
  4. * Usage example:
  5. * <pre>
  6. * logger.warn(e, "something bad happened when connecting to %s:%d", host, port);
  7. * </pre>
  8. * If the format string is invalid or the arguments are insufficient, an error will be logged and execution
  9. * will continue.
  10. *
  11. * @param exception an exception associated with the warning being logged
  12. * @param format a format string compatible with String.format()
  13. * @param args arguments for the format string
  14. */
  15. public void warn(Throwable exception, String format, Object... args)
  16. {
  17. if (logger.isLoggable(WARNING)) {
  18. String message;
  19. try {
  20. message = format(format, args);
  21. }
  22. catch (IllegalFormatException e) {
  23. logger.log(SEVERE, illegalFormatMessageFor("WARN", format, args), e);
  24. message = rawMessageFor(format, args);
  25. }
  26. logger.log(WARNING, message, exception);
  27. }
  28. }

相关文章