Skip to content

Commit

Permalink
Include codecov in the main workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
remychantenay committed Sep 13, 2023
1 parent 8be72c2 commit 815da96
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 37 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/codecov.yaml

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go
name: Main CI

on:
push:
Expand Down Expand Up @@ -32,3 +32,8 @@ jobs:

- name: Testing
run: make test

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ Go package that provides an implementation of `log/slog`'s [Handler interface](h
## Usage
```go
import (
"context"
"log/slog"
"context"
"log/slog"

"go.opentelemetry.io/otel/baggage"
"go.opentelemetry.io/otel/trace"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
slogotel "github.com/remychantenay/slog-otel"
"go.opentelemetry.io/otel/baggage"
"go.opentelemetry.io/otel/trace"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
slogotel "github.com/remychantenay/slog-otel"
)

// 1. Configure slog.
slog.SetDefault(slog.New(slogotel.OtelHandler{
Next: slog.NewJSONHandler(os.Stdout, nil),
Next: slog.NewJSONHandler(os.Stdout, nil),
}))

// 2. Set up your logger.
Expand All @@ -51,23 +51,23 @@ logger.InfoContext(ctx, "Hello world!", "locale", "en_US")
The following initial log:
```json
{
"time": "2023-09-11T08:28:02.77215605Z",
"level": "INFO",
"component": "server",
"msg": "Hello world!",
"locale": "en_US"
"time": "2023-09-11T08:28:02.77215605Z",
"level": "INFO",
"component": "server",
"msg": "Hello world!",
"locale": "en_US"
}
```
... will be written as:
```json
{
"time": "2023-09-11T08:28:02.77215605Z",
"level": "INFO",
"component": "server",
"msg": "Hello world!",
"locale": "en_US",
"trace_id": "a9938fd7a6313e0f27f3fc87f574bff6",
"span_id": "ed58f84d8971bf60"
"time": "2023-09-11T08:28:02.77215605Z",
"level": "INFO",
"component": "server",
"msg": "Hello world!",
"locale": "en_US",
"trace_id": "a9938fd7a6313e0f27f3fc87f574bff6",
"span_id": "ed58f84d8971bf60"
}
```

Expand Down

0 comments on commit 815da96

Please sign in to comment.