Skip to content

Commit d91900d

Browse files
committed
updated README.md file, updated imports to use gopkg.in, added Makefile
1 parent 971ac8a commit d91900d

File tree

7 files changed

+60
-6
lines changed

7 files changed

+60
-6
lines changed

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Binaries for programs and plugins
22
*.exe
3-
*.exe~
43
*.dll
54
*.so
65
*.dylib
@@ -11,6 +10,14 @@
1110
# Output of the go coverage tool, specifically when used with LiteIDE
1211
*.out
1312

13+
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
14+
.glide/
15+
16+
# IDEs folders
1417
.idea/
1518
.vscode/
1619

20+
test-artifacts/
21+
build
22+
tmp
23+

Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
all: format vet deps test build
2+
3+
format:
4+
@echo "formatting files..."
5+
@go get golang.org/x/tools/cmd/goimports
6+
@goimports -w -l .
7+
@gofmt -s -w -l .
8+
9+
vet:
10+
@echo "vetting..."
11+
@go vet ./...
12+
13+
deps:
14+
@echo "installing dependencies..."
15+
@go get ./...
16+
17+
test-deps:
18+
@echo "installing test dependencies..."
19+
@go get github.com/smartystreets/goconvey/convey
20+
@go get gopkg.in/h2non/gock.v1
21+
@go get github.com/stretchr/testify/assert
22+
@go get github.com/axw/gocov/...
23+
@go get github.com/AlekSi/gocov-xml
24+
@go get gopkg.in/matm/v1/gocov-html
25+
26+
test: test-deps
27+
@echo "running test coverage..."
28+
@mkdir -p test-artifacts/coverage
29+
@gocov test ./... -v > test-artifacts/gocov.json
30+
@cat test-artifacts/gocov.json | gocov report
31+
@cat test-artifacts/gocov.json | gocov-xml > test-artifacts/coverage/coverage.xml
32+
@cat test-artifacts/gocov.json | gocov-html > test-artifacts/coverage/coverage.html
33+
34+
build: deps
35+
@echo "building..."
36+
@go build ./...

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,18 @@ This library is does not actually provide a logger implementation but instead by
66

77
## Getting started
88

9+
To keep up to date with the most recent version:
10+
911
```bash
1012
go get github.com/jucardi/go-logger-lib
1113
```
1214

15+
To get a specific version:
16+
17+
```bash
18+
go get gopkg.in/jucardi/go-logger-lib.v1
19+
```
20+
1321
## What inspired me to create this simple library?
1422

1523
Working on a go project that I wanted to make open source, I realized that it would make sense to be able to have a logger and log information based on the results of certain operations. Originally I started using `github.com/sirupsen/logrus` which is a very good Go logging library, but I didn't want the consumers of my project to be forced to use `logrus` if they were already using a different logger.

log/formatter_helpers.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ package log
22

33
import (
44
"fmt"
5-
"github.com/jucardi/go-iso8601"
6-
"github.com/jucardi/go-streams/streams"
7-
"github.com/jucardi/go-terminal-colors"
85
"strings"
96
"text/template"
7+
8+
"gopkg.in/jucardi/go-iso8601.v1"
9+
"gopkg.in/jucardi/go-streams.v1/streams"
10+
"gopkg.in/jucardi/go-terminal-colors.v1"
1011
)
1112

1213
const (

log/formatter_themes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package log
22

3-
import "github.com/jucardi/go-terminal-colors"
3+
import "gopkg.in/jucardi/go-terminal-colors.v1"
44

55
// LevelColorScheme represents the terminal colors associated to the level parsing for each logging level.
66
type LevelColorScheme map[Level][]fmtc.Color

log/level.go

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

33
import (
44
"fmt"
5-
"github.com/jucardi/go-strings/stringx"
5+
6+
"gopkg.in/jucardi/go-strings.v1/stringx"
67
)
78

89
// These are the different logging levels. You can set the logging level to log

log/logger_logrus.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package log
22

33
import (
44
"bytes"
5+
56
"github.com/sirupsen/logrus"
67
)
78

0 commit comments

Comments
 (0)