Java slf4j Logger logEntrance(Logger logger, String methodName, String methodArguments)

Here you can find the source of logEntrance(Logger logger, String methodName, String methodArguments)

Description

Logs for entrance into every public methods with Level#DEBUG .

License

Open Source License

Parameter

Parameter Description
methodName The name of method entranced into.
methodArguments The method arguments
logger the logger instance

Declaration

public static void logEntrance(Logger logger, String methodName, String methodArguments) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.slf4j.Logger;

public class Main {
    /**//  w  w  w  .  j  a v  a 2  s .c o  m
     * <p>
     * The message format pattern used to log the entrance of method.
     * </p>
     */
    private static final String ENTRANCE_METHOD_PATTERN = "Entering method %s.\n\tMethod arguments: [%s].";

    /**
     * <p>
     * Logs for entrance into every public methods with {@link Level#DEBUG}.
     * </p>
     *
     * @param methodName      The name of method entranced into.
     * @param methodArguments The method arguments
     * @param logger          the logger instance
     */
    public static void logEntrance(Logger logger, String methodName, String methodArguments) {
        logger.debug(String.format(ENTRANCE_METHOD_PATTERN, methodName, methodArguments));

    }
}

Related

  1. logArgs(final Logger logger, final Object[] args)
  2. logBind(Logger log, int index, Object value)
  3. logBytes(byte[] data, int length, String prefix, Logger logger)
  4. logDebug(Logger logger, String mensagem, Object... params)
  5. logDebug(String string)
  6. logError(final Logger logger, final String message, final Throwable cause)
  7. logError(Logger log, Throwable t, String message)
  8. logError(String message, Throwable ex, Logger logger, String userId)
  9. logErrors(Logger logger, List strings)