Compare commits

...

2 Commits

Author SHA1 Message Date
Oskar a557f452a7
feat(log): SetReportCaller to true
example output:
INFO[0000]/home/trex/go/src/awesomeProject/main.go:11 main.main() hello world  

from https://stackoverflow.com/a/68301267
2021-10-21 23:18:24 +02:00
Oskar b6fc96d90a
ci: update workflows (#3)
* Update ci.yml
* Delete auto-fix.yml
2021-10-21 23:09:46 +02:00
3 changed files with 33 additions and 26 deletions

View File

@ -1,18 +1,21 @@
name: auto fix
name: CI
on:
push:
branches:
- "**"
- main
pull_request:
jobs:
auto-fix:
ci:
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Repo clone (go mod tidy / gofmt)
if: github.event_name != 'pull_request'
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Go
@ -21,27 +24,46 @@ jobs:
go-version: 1.17
- name: Setup Git
if: github.event_name != 'pull_request'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: tidy
- name: Tidy
if: github.event_name != 'pull_request'
run: |
go mod tidy
git add .
git diff-index --quiet HEAD || git commit -m "go mod tidy"
- name: gofmt
- name: GoFmt
if: github.event_name != 'pull_request'
run: |
go fmt ./...
git add .
git diff-index --quiet HEAD || git commit -m "gofmt"
- name: Pull changes
if: github.event_name != 'pull_request'
run: git pull -r
- name: Push changes
if: github.event_name != 'pull_request'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Repo clone (test)
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Test
run: go test -v ./...
- name: Semantic Release
if: github.event_name != 'pull_request'
uses: go-semantic-release/action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -1,19 +0,0 @@
name: test
on:
push:
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Test
run: go test -v ./...

View File

@ -25,3 +25,7 @@ var Log = &logrus.Logger{
Hooks: make(logrus.LevelHooks),
Level: logrus.InfoLevel,
}
func init() {
Log.SetReportCaller(true)
}