rabbah commented on a change in pull request #2650: Apply standard scala
formatting.
URL:
https://github.com/apache/incubator-openwhisk/pull/2650#discussion_r136238441
##########
File path: common/scala/src/main/scala/whisk/common/Logging.scala
##########
@@ -132,115 +135,115 @@ class PrintStreamLogging(outputStream: PrintStream =
Console.out) extends Loggin
* @param deltaToMarkerStart if this is an end marker, this is the time
difference to the start marker
*/
case class LogMarker(token: LogMarkerToken, deltaToTransactionStart: Long,
deltaToMarkerStart: Option[Long] = None) {
- override def toString() = {
- val parts = Seq(LogMarker.keyword, token.toString,
deltaToTransactionStart) ++ deltaToMarkerStart
- "[" + parts.mkString(":") + "]"
- }
+ override def toString() = {
+ val parts = Seq(LogMarker.keyword, token.toString,
deltaToTransactionStart) ++ deltaToMarkerStart
+ "[" + parts.mkString(":") + "]"
+ }
}
object LogMarker {
- val keyword = "marker"
+ val keyword = "marker"
- /** Convenience method for parsing log markers in unit tests. */
- def parse(s: String) = {
- val logmarker =
raw"\[${keyword}:([^\s:]+):(\d+)(?::(\d+))?\]".r.unanchored
- val logmarker(token, deltaToTransactionStart, deltaToMarkerStart) = s
- LogMarker(LogMarkerToken.parse(token), deltaToTransactionStart.toLong,
Option(deltaToMarkerStart).map(_.toLong))
- }
+ /** Convenience method for parsing log markers in unit tests. */
+ def parse(s: String) = {
+ val logmarker = raw"\[${keyword}:([^\s:]+):(\d+)(?::(\d+))?\]".r.unanchored
+ val logmarker(token, deltaToTransactionStart, deltaToMarkerStart) = s
+ LogMarker(LogMarkerToken.parse(token), deltaToTransactionStart.toLong,
Option(deltaToMarkerStart).map(_.toLong))
+ }
}
private object Logging {
- /**
- * Given a class object, return its simple name less the trailing dollar
sign.
- */
- def getCleanSimpleClassName(clz: Class[_]) = {
- val simpleName = clz.getSimpleName
- if (simpleName.endsWith("$")) simpleName.dropRight(1)
- else simpleName
- }
+
+ /**
+ * Given a class object, return its simple name less the trailing dollar
sign.
+ */
+ def getCleanSimpleClassName(clz: Class[_]) = {
+ val simpleName = clz.getSimpleName
+ if (simpleName.endsWith("$")) simpleName.dropRight(1)
+ else simpleName
+ }
}
private object Emitter {
- val timeFormat = DateTimeFormatter.
- ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").
- withZone(ZoneId.of("UTC"))
+ val timeFormat =
+
DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").withZone(ZoneId.of("UTC"))
Review comment:
blugh - can we make that add curlies?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services