From 6fc742bfaf5ee508a34189400a1a7dbffe3f1cac Mon Sep 17 00:00:00 2001 From: chick Date: Fri, 14 Aug 2020 19:47:53 -0700 Subject: All of src/ formatted with scalafmt --- src/main/scala/logger/LoggerAnnotations.scala | 35 ++++++++++++++++++--------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'src/main/scala/logger/LoggerAnnotations.scala') diff --git a/src/main/scala/logger/LoggerAnnotations.scala b/src/main/scala/logger/LoggerAnnotations.scala index f4dc6b38..b345d617 100644 --- a/src/main/scala/logger/LoggerAnnotations.scala +++ b/src/main/scala/logger/LoggerAnnotations.scala @@ -5,7 +5,6 @@ package logger import firrtl.annotations.{Annotation, NoTargetAnnotation} import firrtl.options.{HasShellOptions, ShellOption} - /** An annotation associated with a Logger command line option */ sealed trait LoggerOption { this: Annotation => } @@ -14,7 +13,9 @@ sealed trait LoggerOption { this: Annotation => } * - if unset, a [[LogLevelAnnotation]] with the default log level will be emitted * @param level the level of logging */ -case class LogLevelAnnotation(globalLogLevel: LogLevel.Value = LogLevel.Warn) extends NoTargetAnnotation with LoggerOption +case class LogLevelAnnotation(globalLogLevel: LogLevel.Value = LogLevel.Warn) + extends NoTargetAnnotation + with LoggerOption object LogLevelAnnotation extends HasShellOptions { @@ -24,7 +25,9 @@ object LogLevelAnnotation extends HasShellOptions { toAnnotationSeq = (a: String) => Seq(LogLevelAnnotation(LogLevel(a))), helpText = s"Set global logging verbosity (default: ${new LoggerOptions().globalLogLevel}", shortOption = Some("ll"), - helpValueName = Some("{error|warn|info|debug|trace}") ) ) + helpValueName = Some("{error|warn|info|debug|trace}") + ) + ) } @@ -33,20 +36,26 @@ object LogLevelAnnotation extends HasShellOptions { * @param name the class name to log * @param level the verbosity level */ -case class ClassLogLevelAnnotation(className: String, level: LogLevel.Value) extends NoTargetAnnotation with LoggerOption +case class ClassLogLevelAnnotation(className: String, level: LogLevel.Value) + extends NoTargetAnnotation + with LoggerOption object ClassLogLevelAnnotation extends HasShellOptions { val options = Seq( new ShellOption[Seq[String]]( longOption = "class-log-level", - toAnnotationSeq = (a: Seq[String]) => a.map { aa => - val className :: levelName :: _ = aa.split(":").toList - val level = LogLevel(levelName) - ClassLogLevelAnnotation(className, level) }, + toAnnotationSeq = (a: Seq[String]) => + a.map { aa => + val className :: levelName :: _ = aa.split(":").toList + val level = LogLevel(levelName) + ClassLogLevelAnnotation(className, level) + }, helpText = "Set per-class logging verbosity", shortOption = Some("cll"), - helpValueName = Some("...") ) ) + helpValueName = Some("...") + ) + ) } @@ -63,7 +72,9 @@ object LogFileAnnotation extends HasShellOptions { longOption = "log-file", toAnnotationSeq = (a: String) => Seq(LogFileAnnotation(Some(a))), helpText = "Log to a file instead of STDOUT", - helpValueName = Some("") ) ) + helpValueName = Some("") + ) + ) } @@ -77,6 +88,8 @@ case object LogClassNamesAnnotation extends NoTargetAnnotation with LoggerOption longOption = "log-class-names", toAnnotationSeq = (a: Unit) => Seq(LogClassNamesAnnotation), helpText = "Show class names and log level in logging output", - shortOption = Some("lcn") ) ) + shortOption = Some("lcn") + ) + ) } -- cgit v1.2.3