Skip to content

Commit

Permalink
docs: install instructions (#7)
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos A Becker <[email protected]>
  • Loading branch information
caarlos0 authored Feb 21, 2023
1 parent 20cb464 commit cf129cc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,18 @@ readable logging with batteries included.

## Usage

Use `go get` to download the dependency, and then `import` it in your Go files:

```bash
go get github.com/charmbracelet/log@latest
```

```go
import "github.com/charmbracelet/log"
```

The Charm logger comes with a global package-wise logger with timestamps turned
on and the logging level set to `info`.
on, and the logging level set to `info`.

```go
log.Debug("Cookie 🍪") // won't print anything
Expand Down Expand Up @@ -164,7 +174,7 @@ Some Go libraries, especially the ones in the standard library, will only accept
the [standard logger][stdlog] interface. For instance, the HTTP Server from
`net/http` will only take a `*log.Logger` for its `ErrorLog` field.

For this, you can use the standard log adapter which simply wraps the logger in
For this, you can use the standard log adapter, which simply wraps the logger in
a `*log.Logger` interface.

```go
Expand Down

0 comments on commit cf129cc

Please sign in to comment.