Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
mlangc committed Mar 6, 2020
1 parent 7208fc1 commit 116a539
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,10 @@ object SomeObject extends LoggingSupport {
logger.errorIO("Game over", new IllegalStateException("This is the end"))
)

doEvenMoreStuff = ZIO.ifM(random.nextBoolean)(
ZIO.sleep(8.millis).as(42), ZIO.fail(new RuntimeException("That didn't work")))

// Generate highly configurable performance logs with ease:
_ <- doEvenMoreStuff.perfLog {
LogSpec.onSucceed[Int]((d, i) => debug"Finally done with $i after ${d.render}").withThreshold(5.millis) ++
LogSpec.onError[Throwable]((d, e) => error"Darn, failed again with $e after only ${d.render}")
}
_ <- ZIO.sleep(8.millis).perfLog(
// See below for more examples with `LogSpec`
LogSpec.onSucceed[Int]((d, i) => debug"Finally done with $i after ${d.render}")
.withThreshold(5.millis))
} yield ()
}
}
Expand Down

0 comments on commit 116a539

Please sign in to comment.