Created
August 28, 2017 22:33
-
-
Save gabfssilva/acb59b498213bd63a2af3b59716708cc to your computer and use it in GitHub Desktop.
akka http loggedRequest
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def loggedRequest(magnet: LoggingMagnet[String ⇒ Unit]): Directive0 = extractRequestContext.flatMap { ctx ⇒ | |
val timer = Timer.start | |
mapRouteResult { | |
case result: Complete => | |
//extracting request and complete route result here | |
result | |
case result: Rejected => | |
//extracting request and rejected route result here | |
result | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment