Skip to content

Commit

Permalink
Removed unnecessary braces.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtar committed Jan 13, 2025
1 parent b50d53b commit b28f57e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
3 changes: 2 additions & 1 deletion core/src/main/scala/com/evolutiongaming/catshelper/Log.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import scala.collection.immutable.SortedMap
* instances accidentally.
*
* @see [[LogOf]] for usage examples.
* @see [[org.slf4j.Logger]] for a typical underlying implementation.
* @see [[https://slf4j.org/api/org/slf4j/Logger.html Logger]] for a typical
* underlying implementation.
*/
trait Log[F[_]] {

Expand Down
24 changes: 11 additions & 13 deletions core/src/main/scala/com/evolutiongaming/catshelper/LogOf.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,21 @@ import scala.reflect.ClassTag
* {{{
* class UserService[F[_]: Monad](log: Log[F]) {
*
* def create(user: User): F[Unit] = {
* for {
* _ <- log.info(s"Creating user...")
* _ <- ...
* } yield ()
* }
* def create(user: User): F[Unit] =
* for {
* _ <- log.info(s"Creating user...")
* _ <- ...
* } yield ()
*
* }
*
* object UserService {
*
* def of[F[_]: LogOf]: F[UserService[F]] = {
* def of[F[_]: LogOf]: F[UserService[F]] =
* for {
* log <- LogOf[F].forClass[UserService]
* service = new UserService[F](log)
* } yield service
* }
*
* }
* }}}
Expand Down Expand Up @@ -77,26 +76,24 @@ import scala.reflect.ClassTag
* {{{
* class HandleService[F[_]: Monad] {
*
* def create(logOf: LogOf[F]): F[String] = {
* def create(logOf: LogOf[F]): F[String] =
* for {
* log <- logOf.forClass[HandleService]
* _ <- log.info(s"Creating handle...")
* _ <- ...
* } yield ()
* }
*
* }
*
* class UserService[F[_]: Monad](handleService: HandleService[F]) {
*
* def create(user: User, logOf: LogOf[F]): F[Unit] = {
* def create(user: User, logOf: LogOf[F]): F[Unit] =
* for {
* log <- logOf.forClass[UserService]
* _ <- log.info(s"Creating user...")
* handle <- handleService.create(logOf.withField("user", user.id))
* _ <- ...
* } yield ()
* }
*
* }
*
Expand All @@ -112,7 +109,8 @@ import scala.reflect.ClassTag
* both `LogOf` and `Log` instances on each call, but allows passing an
* additional context to the called methods.
*
* @see [[org.slf4j.LoggerFactory]] for a typical underlying implementation.
* @see [[https://slf4j.org/api/org/slf4j/LoggerFactory.html LoggerFactory]]
* for a typical underlying implementation.
*/
trait LogOf[F[_]] {

Expand Down

0 comments on commit b28f57e

Please sign in to comment.