-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add loggers configuration #278
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package fly4s.data | ||
Check notice Code scanning / Scalastyle (reported by Codacy) File must not end with newline character. Note
File must not end with newline character.
Check notice Code scanning / Scalastyle (reported by Codacy) Header does not match expected text. Note
Header does not match expected text.
|
||
|
||
sealed trait LoggerType | ||
object LoggerType { | ||
case object Auto extends LoggerType | ||
case object Console extends LoggerType | ||
case object Slf4j extends LoggerType | ||
case object Log4j2 extends LoggerType | ||
case object ApacheCommons extends LoggerType | ||
case class Custom(fullyQualifiedClassName: String) extends LoggerType | ||
|
||
def fromFlywayValue(value: String): LoggerType = value match { | ||
case "auto" => Auto | ||
|
||
case "console" => Console | ||
|
||
case "slf4j" => Slf4j | ||
|
||
case "log4j2" => Log4j2 | ||
|
||
case "apache-commons" => ApacheCommons | ||
|
||
case custom => Custom(custom) | ||
Check notice Code scanning / Codacy-scalameta-pro (reported by Codacy) Prohibit case statement pattern match from being lowercase. Note
Lower case pattern matching.
Check notice Code scanning / Scalastyle (reported by Codacy) Lowercase pattern match (surround with ``, or add : Any). Note
Lowercase pattern match (surround with ``, or add : Any).
|
||
} | ||
|
||
def toFlywayValue(ltype: LoggerType): String = | ||
ltype match { | ||
case LoggerType.Auto => "auto" | ||
case LoggerType.Console => "console" | ||
case LoggerType.Slf4j => "slf4j" | ||
case LoggerType.Log4j2 => "log4j2" | ||
case LoggerType.ApacheCommons => "apache-commons" | ||
case LoggerType.Custom(fullyQualifiedClassName) => fullyQualifiedClassName | ||
} | ||
} |
Check notice
Code scanning / Scalastyle (reported by Codacy)
Field name does not match the regular expression '^[A-Z][A-Za-z0-9]*$'. Note