Skip to content

Commit

Permalink
Merge da1713d into f7ca803
Browse files Browse the repository at this point in the history
  • Loading branch information
xufeisofly committed May 14, 2021
2 parents f7ca803 + da1713d commit 5011494
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: golangci-lint
on:
push:
tags:
- v*
branches:
- master
pull_request:
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.26

# Optional: working directory, useful for monorepos
# working-directory: somedir

# Optional: golangci-lint command line arguments.
# args: --issues-exit-code=0

# Optional: show only new issues if it's a pull request. The default value is `false`.
# only-new-issues: true
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ func New(opts ...Option) (*Chell, error)
func Dump(dst, src interface{}, opts ...Option) error
func DumpWithContext(ctx context.Context, dst, src interface{}, opts ...Option)
func SetDebug(v bool)
func SetLogLevel(level LogLevel)
func SetMaxPoolSize(size int)
func CleanUp()
```
Expand Down
1 change: 1 addition & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ func New(opts ...Option) (*Chell, error)
func Dump(dst, src interface{}, opts ...Option) error
func DumpWithContext(ctx context.Context, dst, src interface{}, opts ...Option)
func SetDebug(v bool)
func SetLogLevel(level LogLevel)
func SetMaxPoolSize(size int)
func CleanUp()
```
Expand Down
14 changes: 14 additions & 0 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,17 @@ func SetDebug(v bool) {
logger.SetLevel(logrus.InfoLevel)
}
}

type LogLevel = logrus.Level

const (
ErrorLevel = logrus.ErrorLevel
WarnLevel = logrus.WarnLevel
InfoLevel = logrus.InfoLevel
DebugLevel = logrus.DebugLevel
)

// SetLogLevel block the logs who's level is lower
func SetLogLevel(level LogLevel) {
logger.SetLevel(level)
}

0 comments on commit 5011494

Please sign in to comment.