Generates a custom log for all of the error/info/warn/debug messages sent.

@return A string containing the contents of the logs
18901
public String generateLogs(boolean includeLevel) {
        final StringBuilder output = new StringBuilder();
        final ArrayList<LogMessage> messages = new ArrayList<LogMessage>();
        for (final String logName : logs.keySet()) {
            messages.addAll(logs.get(logName).getLogMessages());
        }
        Collections.sort(messages, new LogMessageComparator());
        for (final LogMessage msg : messages) {
            if (includeLevel) {
                output.append(msg.getMessage());
            } else {
                output.append(msg.getOriginalMessage());
            }
            output.append("\n");
        }
        return output.toString();
    }
440370
String constructLogMsg() {
    final StringBuilder msg = new StringBuilder();

    for (final Map.Entry<String, List<StackTraceElement>> e : paramToStackTrace.build().entries()) {
      msg.append("Parameter ").append(e.getKey()).append(" accessed at \n");
      msg.append(FluentIterable.from(e.getValue())
          // but exclude code in Parameters itself
          .filter(not(IS_THIS_CLASS))
          .filter(not(IS_PARAMETERS_ITSELF))
          .filter(not(IS_THREAD_CLASS))
          .join(StringUtils.unixNewlineJoiner()));
      msg.append("\n\n");
    }
    return msg.toString();
  }
470468
public final String getExceptionMessage() {
        /* If the Exception information is set, return the translated message */
        if (getHdr2().getChoiceField(JsHdr2Access.EXCEPTION) != JsHdr2Access.IS_EXCEPTION_EMPTY) {
            return exceptionMessages.getFormattedMessage(MfpConstants.EXCEPTION_MESSAGE_KEY_PREFIX + getExceptionReason().toString()
                                                         , getExceptionInserts()
                                                         , "Failed to deliver message, rc=" + getExceptionReason() + ". Inserts: " + Arrays.asList(getExceptionInserts())
                            );
        }
        /* If no, just return null. */
        else {
            return null;
        }
    }
1180987
public static String logLevelToString(final int level) {
        String logLevel;
        switch (level) {
            case Project.MSG_DEBUG:
                logLevel = "DEBUG";
                break;
            case Project.MSG_VERBOSE:
                logLevel = "VERBOSE";
                break;
            case Project.MSG_INFO:
                logLevel = "INFO";
                break;
            case Project.MSG_WARN:
                logLevel = "WARN";
                break;
            case Project.MSG_ERR:
                logLevel = "ERROR";
                break;
            default:
                logLevel = "UNKNOWN";
                break;
        }
        return logLevel;

    }
165896
@Override
    @Trivial
    protected String getExecutionLogMessage(MessageType msgType) {

        LogHelper lh = new LogHelper();
        StringBuilder buf = lh.getBeginningPart(msgType);

        buf.append("invoking execution for a job");
        buf.append("\n JobInstance id = ");
        buf.append(getTopLevelNameInstanceExecutionInfo().getInstanceId());
        buf.append("\n JobExecution id = ");
        buf.append(getTopLevelNameInstanceExecutionInfo().getExecutionId());
        buf.append("\n Job Name = ");
        buf.append(getTopLevelNameInstanceExecutionInfo().getJobName());

        if (jobParameters != null) {
            buf.append("\n Job Parameters = ");
            buf.append(jobParameters);
        }

        if (!msgType.equals(MessageType.STARTED)) {
            buf.append("\n Job Batch Status = " + getBatchStatus());
            buf.append(", Job Exit Status = " + getExitStatus());
        }
        buf.append("\n" + LogHelper.dashes);
        return buf.toString();
    }
661884
private BuildLogger createLogger() {
        BuildLogger logger;
        if (args.loggerClassname != null) {
            try {
                logger = ClasspathUtils.newInstance(args.loggerClassname, Main.class.getClassLoader(),
                        BuildLogger.class);
            } catch (final BuildException e) {
                printErrorMessage("The specified logger class " + args.loggerClassname + " could not be used because "
                        + e.getMessage());
                throw new RuntimeException();
            }
        } else {
            logger = new DefaultLogger();
            ((DefaultLogger) logger).useColor(args.useColor);
        }

        logger.setMessageOutputLevel(args.msgOutputLevel);
        logger.setOutputPrintStream(out);
        logger.setErrorPrintStream(err);
        logger.setEmacsMode(args.emacsMode);

        return logger;
    }
607316
@JsonIgnore
    public String getErrorMessage(){
        StringBuilder sb = new StringBuilder();
        sb.append(exceptionCode.getCode()).append(":").append(exceptionCode.getMessage());
        if(this.message != null && ! this.message.isEmpty()){
            sb.append(" - ").append(message);
        }
        return sb.toString();
    }
218627
public String buildErrorMessages() {

        StringBuffer result = new StringBuffer(8);
        String errorMessages = getErrorMessagesString();
        if (!"".equals(errorMessages)) {
            result.append(dialogBlock(HTML_START, key(Messages.GUI_PERMISSION_ERROR_0), true));
            result.append("<font color='red'>").append(errorMessages).append("</font>");
            result.append(dialogBlockEnd());
        }
        return result.toString();
    }
594369
protected function getContextMessage()
    {
        $context = [];
        foreach ($this->logVars as $name) {
            if (!empty($GLOBALS[$name])) {
                $context[] = "\${$name} = " . VarDumper::dumpAsString($GLOBALS[$name]);
            }
        }

        return implode("\n\n", $context);
    }
1275186
public void generateLogMessage() {
    if (lastRowLogged != currRow) {
      P6LogQuery.log(Category.RESULTSET, this);
      resultMap.clear();
      lastRowLogged = currRow;
    }
  }
595279
public String getMessage() {
        Throwable rock = getUndeclaredThrowable();
        if (rock != null) {
            return rock.getMessage();
        }
        else {
            return super.getMessage();
        }
    }
93433
public java.lang.String getErrorMessage() {
    java.lang.Object ref = errorMessage_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      if (bs.isValidUtf8()) {
        errorMessage_ = s;
      }
      return s;
    }
  }
365384
function writeLogs(customMethods) {

	// Error level logging with a message but no error
	console.error('Testing ERROR LEVEL without actual error')
	
	// Error level logging with an error but no message
	// This shows enhanced error parsing in logging 
	console.error(new Error("some error"));

	// Error level logging with both message and error
	// This shows enhanced error parsing in logging 
	console.error('Testing ERROR LEVEL with an error', new Error("some error"));
	
	// Warn level logging
	console.warn('Testing WARN LEVEL');

	// Info level logging
	console.info('Testing INFO LEVEL');

	// Log/Debug level logging
	console.log('Testing LOG LEVEL');	
	
	if(customMethods) {
		// Log/Debug level loggin using "debug" alias (not standard but clearer)
		console.debug('Testing DEBUG (AKA LOG) LEVEL');
		
		// Verbose level logging (new level added to go beyond DEBUG)
		console.verbose('Testing TRACE LEVEL');	
	}
}
580526
private Object toLogString(HttpRequestMessage httpRequest) {
        StringBuilder b = new StringBuilder();
        b.append(httpRequest.getRequestURI()).append('\n');
        final Map<String,List<String>> headers = httpRequest.getHeaders();
        for ( String h: headers.keySet()) {
            b.append(h).append(':').append(' ').append(headers.get(h)).append('\n');
        }
        return b.toString();
    }
656660
public String getMessage()
    {
        String base = super.getMessage();

        if( null == base )
        {
            return "Failed to access " + m_variable + " environment variable";
        }

        return "Failed to access " + m_variable + " environment variable - " + base;
    }
814557
@Override
    public String getMessage() {
        return new StringBuilder()
                .append("Request [").append(requestMethod.toString()).append("] ")
                .append("to URL: ").append(requestUri).append(" has failed with ")
                .append("Status code: ")
                .append(statusCode).append('\n')
                .append("Status message: ")
                .append(statusMessage).append('\n')
                .append("Content: '").append(content).append('\'')
                .toString();
    }
718020
public static String debug() {
		StringBuilder s = new StringBuilder();
		for (TaskManager tm : resources.values())
			tm.debug(s);
		return s.toString();
	}