Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/vipshop/Saturn into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
he7g committed Sep 25, 2018
2 parents c4f7caf + a6a6ee7 commit 2f01b10
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions saturn-core/src/main/java/com/vip/saturn/job/utils/LogUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
public class LogUtils {

private static final String FORMAT_FOR_LOG = "[{}] msg={}";
private static final String FORMAT_FOR_STRING = "[%s] msg=%s";

private static String constructFormatOrMsg(String eventName, String formatOrMsg) {
return String.format(FORMAT_FOR_STRING, eventName, formatOrMsg);
}

// debug begin

/**
* @param logger slf4j logger
Expand Down Expand Up @@ -75,8 +68,6 @@ public static void debug(Logger logger, String eventName, String msg, Throwable
}
}

// info begin

/**
* @param logger slf4j logger
* @param eventName 事件名
Expand Down Expand Up @@ -127,8 +118,6 @@ public static void info(Logger logger, String eventName, String msg, Throwable t
logger.info(constructFormatOrMsg(eventName, msg), t);
}

// warn begin

/**
* @param logger slf4j logger
* @param eventName 事件名
Expand Down Expand Up @@ -179,8 +168,6 @@ public static void warn(Logger logger, String eventName, String msg, Throwable t
logger.warn(constructFormatOrMsg(eventName, msg), t);
}

// error begin

/**
* @param logger slf4j logger
* @param eventName 事件名
Expand Down Expand Up @@ -231,4 +218,7 @@ public static void error(Logger logger, String eventName, String msg, Throwable
logger.error(constructFormatOrMsg(eventName, msg), t);
}

private static String constructFormatOrMsg(String eventName, String formatOrMsg) {
return new StringBuilder("[").append(eventName).append("] msg=").append(formatOrMsg).toString();
}
}

0 comments on commit 2f01b10

Please sign in to comment.