Here you can find the source of logExit(Logger logger, String methodName, String returnValue, long timeSpent)
Logs for exit from every public methods with Level#DEBUG .
Parameter | Description |
---|---|
methodName | The name of method existed from. |
returnValue | the return value |
timeSpent | the time spent |
logger | the logger instance |
verboseLogging | the control flag defining whether the detailed logging actions should be performed |
public static void logExit(Logger logger, String methodName, String returnValue, long timeSpent)
//package com.java2s; //License from project: Open Source License import org.slf4j.Logger; public class Main { /**/*from www. j a v a 2 s .c o m*/ * <p> * The message format pattern used to log the exit of method. * </p> */ private static final String EXIT_METHOD_PATTERN = "Exiting method %s.\n\tReturn value: [{%s}].\n\tTime spent in the method: {2" + "%d} milliseconds."; /** * <p> * Logs for exit from every public methods with {@link Level#DEBUG}. * </p> * * @param methodName The name of method existed from. * @param returnValue the return value * @param timeSpent the time spent * @param logger the logger instance * @param verboseLogging the control flag defining whether the detailed logging actions should be performed */ public static void logExit(Logger logger, String methodName, String returnValue, long timeSpent) { logger.debug(String.format(EXIT_METHOD_PATTERN, methodName, returnValue, timeSpent)); } }