Skip to content

Commit

Permalink
Port docs
Browse files Browse the repository at this point in the history
  • Loading branch information
danicheg committed Jan 31, 2022
1 parent 7d58e9c commit f99792e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
4 changes: 0 additions & 4 deletions docs/Gemfile

This file was deleted.

29 changes: 19 additions & 10 deletions docs/src/main/mdoc/index.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
---
layout: home
# log4cats

---
# log4cats [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.typelevel/log4cats-core_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.typelevel/log4cats-core_2.12)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.typelevel/log4cats-core_2.12/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.typelevel/log4cats-core_2.12)

## Project Goals

Expand All @@ -12,13 +10,13 @@ or you can use any of the supported backends, or create your own.

## Quick Start

To use log4cats in an existing SBT project with Scala 2.11 or a later version, add the following dependency to your
To use log4cats in an existing SBT project with Scala 2.12 or a later version, add the following dependency to your
`build.sbt`:

```scala
libraryDependencies ++= Seq(
"org.typelevel" %% "log4cats-core" % "<version>", // Only if you want to Support Any Backend
"org.typelevel" %% "log4cats-slf4j" % "<version>", // Direct Slf4j Support - Recommended
"org.typelevel" %% "log4cats-core" % "@VERSION@", // Only if you want to Support Any Backend
"org.typelevel" %% "log4cats-slf4j" % "@VERSION@" // Direct Slf4j Support - Recommended
)
```

Expand All @@ -32,7 +30,7 @@ import cats.implicits._

object MyThing {
// Impure But What 90% of Folks I know do with log4s
implicit def unsafeLogger[F[_]: Sync] = Slf4jLogger.unsafeCreate[F]
implicit def logger[F[_]: Sync]: Logger[F] = Slf4jLogger.getLogger[F]

// Arbitrary Local Function Declaration
def doSomething[F[_]: Sync]: F[Unit] =
Expand Down Expand Up @@ -62,7 +60,7 @@ def passForEasierUse[F[_]: Sync: Logger] = for {

### Laconic syntax

It's possible to use interpolated syntax for logging.
It's possible to use interpolated syntax for logging.
Currently, supported ops are: `trace`, `debug`, `info`, `warn`, `error`.
You can use it for your custom `Logger` as well as for Slf4j `Logger`.

Expand All @@ -83,4 +81,15 @@ def log[F[_]: Sync: Logger] =
case _ => error"We got an error!"
}
} yield ()
```
```

## CVE-2021-44228 ("log4shell")

log4cats is not directly susceptible to CVS-2021-44228. The
log4cats-slf4j implementation delegates all logging operations to
[slf4j][slf4j]. if you use log4cats-slf4j, your configured slf4j
provider may put you at risk. See [slf4j's comments on
CVE-2021-44228][slf4j-log4shell] for more.

[slf4j]: https://www.slf4j.org/
[slf4j-log4shell]: https://www.slf4j.org/log4shell.html

0 comments on commit f99792e

Please sign in to comment.