Here you can find the source of logError(final Logger logger, final String message, final Throwable cause)
Parameter | Description |
---|---|
logger | the logger to use |
message | the message to display |
cause | the chained exception |
public static void logError(final Logger logger, final String message, final Throwable cause)
//package com.java2s; // Licensed under the MIT license. See License.txt in the project root. import org.slf4j.Logger; public class Main { /**//from w ww .j ava 2 s . c om * IntelliJ bubbles up all error level logging to user, and if there is a "cause", it makes it a clickable link * and user can view the stacktrace. * * However, IntelliJ also exposes an button to disable this plugin on the stacktrace viewer, which is not * desirable, so in this case we just log the error message, but show the cause in a warning log * * @param logger the logger to use * @param message the message to display * @param cause the chained exception */ public static void logError(final Logger logger, final String message, final Throwable cause) { logger.error(message); //weird thing we are doing for IntelliJ logger.warn(message, cause); } }