Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release/1.6.13 #16

Merged
merged 5 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/snyk-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Snyk CLI to check for security issues
# Snyk can be used to break the build when it detects security issues.
# In this case we want to upload the SAST issues to GitHub Code Scanning
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Thanks to:
# https://github.com/mvdan/github-actions-golang
on: [push, pull_request]
on:
push:
branches: [ dev, master ]
pull_request:
branches: [ dev, master ]
name: Test
jobs:
test:
Expand All @@ -11,11 +15,11 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout package
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Download credentials
run: |
echo "$GOOGLE_CLOUD_KEY" > gcloud-key.json
Expand All @@ -28,7 +32,7 @@ jobs:
GOOGLE_PROJECT_ID: ${{ secrets.GOOGLE_PROJECT_ID }}
GOOGLE_APPLICATION_CREDENTIALS: "${{ github.workspace }}/gcloud-key.json"
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.out
Expand Down
3 changes: 2 additions & 1 deletion examples/set-level-with-signal/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build linux || darwin
// +build linux darwin

package main
Expand All @@ -22,7 +23,7 @@ func generateSomeLogs(logger *logger.Logger) (stop chan struct{}) {
case <-stop:
logger.Infof("Stopping...")
return
case <-time.After(5*time.Second):
case <-time.After(5 * time.Second):
logger.Fatalf("Something went very wrong")
logger.Errorf("Something went wrong")
logger.Warnf("You should pay attention")
Expand Down
2 changes: 1 addition & 1 deletion level_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func ParseLevels(settings string) (levels LevelSet) {
// Pattern to match a list of topic/scope levels
// See: https://regex101.com/r/GFjOje/1
var (
pattern = regexp.MustCompile(`\s*(?P<LEVEL>[A-Z]+)(?::\{(?P<TOPIC>\w+)?(?::(?P<SCOPES>\w+\s*(?:,\s*\w+)?))?\})?\s*(?:;\s*|$)`)
pattern = regexp.MustCompile(`\s*(?P<LEVEL>[a-zA-Z]+)(?::\{(?P<TOPIC>\w+)?(?::(?P<SCOPES>\w+\s*(?:,\s*\w+)?))?\})?\s*(?:;\s*|$)`)
matches = pattern.FindAllStringSubmatch(settings, -1)
levelGroup = pattern.SubexpIndex("LEVEL")
topicGroup = pattern.SubexpIndex("TOPIC")
Expand Down
7 changes: 7 additions & 0 deletions level_set_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,10 @@ func (suite *LevelSetSuite) TestCanTellIfLevelIsWritable() {
suite.Assert().True(levels.ShouldWrite(logger.INFO, "topic4", "scope4"), "Should write INFO for topic4, scope4")
suite.Assert().False(levels.ShouldWrite(logger.DEBUG, "topic4", "scope4"), "Should not write DEBUG for topic4, scope4")
}

func (suite *LevelSetSuite) TestCanParseLowerCase() {
settings := "warn"
levels := logger.ParseLevels(settings)
suite.Require().Len(levels, 1, "Levels should have 1 entry")
suite.Assert().Equal(logger.WARN, levels.Get("any", "any"), "Default Level Should be WARN")
}
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ package logger
var commit string

// VERSION is the version of this application
var VERSION = "1.6.12" + commit
var VERSION = "1.6.13" + commit
Loading