Skip to content

Commit 0990d19

Browse files
author
paweliwanow
committed
Changed examples in README
1 parent f8400af commit 0990d19

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ implicit case object CanLogCorrelationId extends CanLog[CorrelationId] {
9292
implicit val correlationId = CorrelationId("ID")
9393

9494
val logger = Logger.takingImplicit[CorrelationId]("test")
95-
logger.info("Test") // logs "ID Test"
95+
logger.info("Test") // takes implicit correlationId and logs "ID Test"
9696
```
9797

9898
It's possible to use `MDC` through `CanLog` without any troubles with execution context.
@@ -113,7 +113,13 @@ implicit case object CanLogCorrelationId extends CanLog[CorrelationId] {
113113
implicit val correlationId = CorrelationId("ID")
114114

115115
val logger = Logger.takingImplicit[CorrelationId]("test")
116-
Future(logger.info("Test"))
116+
117+
def serviceMethod(implicit correlationId: CorrelationId): Future[Result] = {
118+
dbCall.map { value =>
119+
logger.trace(s"Received value $value from db") // takes implicit correlationId
120+
toResult(value)
121+
}
122+
}
117123
```
118124

119125
### What's new?

0 commit comments

Comments
 (0)