Here you can find the source of profilerTrigger2(Logger log, String msg)
public static void profilerTrigger2(Logger log, String msg)
//package com.java2s; /*//from www.ja v a 2s .c o m * Copyright 2012-2013 inBloom, Inc. and its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import org.slf4j.Logger; public class Main { private static boolean includeExceptionMessage; public static void profilerTrigger2(Logger log, String msg) { log.info("profilerTrigger2(); called"); } /** * Write the appropriate info message to the log file * * @param log * logger to write the message * @param message * specific message to write to the log file * @param exception * the exception which caused the log file entry */ public static void info(Logger log, String message, Throwable exception) { // Log the error with a message-safe exception. if (log.isInfoEnabled()) { Throwable loggingException = createLoggingException(exception); log.info(message, loggingException); } } /** * Create a message-safe exception from the original exception * * @param exception * original exception from which the message-safe exception will be created * * @return Exception * the new message-safe exception */ private static Throwable createLoggingException(Throwable exception) { return createLoggingException(exception, includeExceptionMessage); } /** * Create a message-safe exception from the original exception * * @param exception * original exception from which the message-safe exception will be created * * @return Exception * the new message-safe exception */ public static Throwable createLoggingException(Throwable exception, boolean includeMessage) { if (includeMessage) { return exception; } Exception loggingException; if (exception.getCause() == null) { loggingException = new Exception(exception.getClass().toString()); //NOPMD Need to use raw exception as type of exception is unknown } else { loggingException = new Exception(exception.getClass().toString(), //NOPMD Need to use raw exception as type of exception is unknown createLoggingException(exception.getCause(), includeMessage)); } loggingException.setStackTrace(exception.getStackTrace()); return loggingException; } }