
org.cloudfoundry.gradle.tasks.LogsCloudFoundryHelper.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cf-gradle-plugin Show documentation
Show all versions of cf-gradle-plugin Show documentation
A Gradle plugin that makes it easy to deploy Gradle-based applications to Cloud Foundry instances.
The newest version!
package org.cloudfoundry.gradle.tasks
import org.cloudfoundry.client.lib.domain.ApplicationLog
class LogsCloudFoundryHelper {
String formatLogEntry(ApplicationLog logEntry) {
"${formatTimestamp(logEntry.timestamp)} ${formatSource(logEntry.sourceName, logEntry.sourceId)} ${formatType(logEntry.messageType)} ${logEntry.message}"
}
String formatTimestamp(Date timestamp) {
timestamp.format("yyyy-MM-dd'T'HH:mm:ss.SSSZ")
}
String formatSource(String sourceName, String sourceId) {
String source = sourceName
if (source.equals("App")) {
source += "/${sourceId}"
}
"[${source}]".padRight(10)
}
String formatType(def messageType) {
messageType.toString() - 'STD'
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy