-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
26 lines (25 loc) · 854 Bytes
/
build.sbt
File metadata and controls
26 lines (25 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
val logThenFailTask = TaskKey[File](
"log-then-fail-task",
"Make an info, warning and error log then throws an exception"
)
lazy val `log-level` = (project in file("."))
.settings(
commands += Command.command(
"logThenFail",
"Make some loggings then fail the command",
"Make some loggings then fail the command"
)(
state => {
state.log.info("Some info")
state.log.warn("Some warnings")
state.log.error("Some errors")
throw new MessageOnlyException("Terminating error")
}
),
logThenFailTask := Def.task {
streams.value.log.info("Some info")
streams.value.log.warn("Some warnings")
streams.value.log.error("Some errors")
throw new MessageOnlyException("Terminating error")
}.value
)