* Correct type of response in logging directive samples #21009 * Updates to signatures in the docs as well
This commit is contained in:
parent
6fb2d176a1
commit
27efafecfc
4 changed files with 22 additions and 23 deletions
|
|
@ -10,9 +10,7 @@ Signature
|
|||
|
||||
def logRequestResult(marker: String)(implicit log: LoggingContext): Directive0
|
||||
def logRequestResult(marker: String, level: LogLevel)(implicit log: LoggingContext): Directive0
|
||||
def logRequestResult(show: HttpRequest => HttpResponsePart => Option[LogEntry])
|
||||
(implicit log: LoggingContext): Directive0
|
||||
def logRequestResult(show: HttpRequest => Any => Option[LogEntry])(implicit log: LoggingContext): Directive0
|
||||
def logRequestResult(show: HttpRequest => RouteResult => Option[LogEntry])(implicit log: LoggingContext): Directive0
|
||||
|
||||
The signature shown is simplified, the real signature uses magnets. [1]_
|
||||
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ Signature
|
|||
|
||||
def logResult(marker: String)(implicit log: LoggingContext): Directive0
|
||||
def logResult(marker: String, level: LogLevel)(implicit log: LoggingContext): Directive0
|
||||
def logResult(show: Any => String)(implicit log: LoggingContext): Directive0
|
||||
def logResult(show: Any => LogEntry)(implicit log: LoggingContext): Directive0
|
||||
def logResult(magnet: LoggingMagnet[Any => Unit])(implicit log: LoggingContext): Directive0
|
||||
def logResult(show: RouteResult => String)(implicit log: LoggingContext): Directive0
|
||||
def logResult(show: RouteResult => LogEntry)(implicit log: LoggingContext): Directive0
|
||||
def logResult(magnet: LoggingMagnet[RouteResult => Unit])(implicit log: LoggingContext): Directive0
|
||||
|
||||
The signature shown is simplified, the real signature uses magnets. [1]_
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ Description
|
|||
Logs the response.
|
||||
|
||||
See :ref:`-logRequest-` for the general description how these directives work. This directive is different
|
||||
as it requires a ``LoggingMagnet[Any => Unit]``. Instead of just logging ``HttpResponses``, ``logResult`` is able to
|
||||
as it requires a ``LoggingMagnet[RouteResult => Unit]``. Instead of just logging ``HttpResponses``, ``logResult`` is able to
|
||||
log any :ref:`RouteResult` coming back from the inner route.
|
||||
|
||||
Use ``logRequest`` for logging the request, or ``logRequestResult`` for logging both.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue