Skip to content

Commit 61d04c7

Browse files
Elliot ForbesElliot Forbes
authored andcommitted
Some additional updates
1 parent 58a5c4c commit 61d04c7

File tree

4 files changed

+8
-16
lines changed

4 files changed

+8
-16
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ log.Error(ctx, "oh my goodness")
3030
// {"level":"error","msg":"oh my goodness","time":"2022-07-23T12:01:43+01:00","trace_id":"my-trace-id"}
3131
```
3232

33+
## To Do:
34+
35+
* Tests that capture the system log and perform appropriate validations.
36+
* Benchmarking & Profiling.
37+
3338
## Contributing
3439

3540
This is a very early rendition of this package. I'll likely expand this out as I start to adopt it in TutorialEdge's services.
@@ -38,4 +43,4 @@ If you'd like to accelerate the development, feel free to submit a Pull Request.
3843

3944
## Attribution
4045

41-
It should be noted this was heavily inspired by the usability of a library developed within CircleCI for our Go applications. I've distilled some of the core concepts down into this far smaller, focused library.
46+
It should be noted this was heavily inspired by the usability of a library developed within CircleCI for our Go applications. I've distilled some of the core concepts down into this far smaller, focused library.

info.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@ package ctxlog
22

33
import (
44
"context"
5-
6-
"github.com/sirupsen/logrus"
75
)
86

97
func (l *CtxLogger) Info(ctx context.Context, msg string) {
108
fields := convertFieldsToLogrusFields(getFields(ctx))
119
l.Log.WithFields(fields).Info(msg)
1210
}
13-
14-
func (l *CtxLogger) InfoFn(ctx context.Context, logFun logrus.LogFunction) {
15-
fields := convertFieldsToLogrusFields(getFields(ctx))
16-
l.Log.WithFields(fields).InfoFn(logFun)
17-
}

logger_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ package ctxlog_test
22

33
import (
44
"context"
5-
"github.com/TutorialEdge/ctxlog"
65
"testing"
6+
7+
"github.com/TutorialEdge/ctxlog"
78
)
89

910
func TestLogger(t *testing.T) {

warn.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,9 @@ package ctxlog
22

33
import (
44
"context"
5-
6-
"github.com/sirupsen/logrus"
75
)
86

97
func (l *CtxLogger) Warn(ctx context.Context, msg string) {
108
fields := convertFieldsToLogrusFields(getFields(ctx))
119
l.Log.WithFields(fields).Warn(msg)
1210
}
13-
14-
func (l *CtxLogger) Warn(ctx context.Context, logFunc logrus.LogFunction) {
15-
fields := convertFieldsToLogrusFields(getFields(ctx))
16-
l.Log.WithFields(fields).WarnFn(logFunc)
17-
}

0 commit comments

Comments
 (0)