Java slf4j Logger logError(Logger log, Throwable t, String message)

Here you can find the source of logError(Logger log, Throwable t, String message)

Description

log Error

License

Open Source License

Declaration

public static void logError(Logger log, Throwable t, String message) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2014 Weasis Team./* w ww.jav a2s.  c  o m*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Nicolas Roduit - initial API and implementation
 *******************************************************************************/

import org.slf4j.Logger;

public class Main {
    public static void logError(Logger log, Throwable t, String message) {
        if (log.isDebugEnabled()) {
            log.error(message, t);
        } else {
            log.error(t.getMessage());
        }
    }
}

Related

  1. logBytes(byte[] data, int length, String prefix, Logger logger)
  2. logDebug(Logger logger, String mensagem, Object... params)
  3. logDebug(String string)
  4. logEntrance(Logger logger, String methodName, String methodArguments)
  5. logError(final Logger logger, final String message, final Throwable cause)
  6. logError(String message, Throwable ex, Logger logger, String userId)
  7. logErrors(Logger logger, List strings)
  8. LogException(Logger log, String descrption, Throwable e)
  9. logExit(Logger logger, String methodName, String returnValue, long timeSpent)