mirror of
https://github.com/fumiama/WireGold.git
synced 2026-06-10 19:50:30 +08:00
fix(ci): debug log printing
This commit is contained in:
5
.github/workflows/ci.yml
vendored
5
.github/workflows/ci.yml
vendored
@@ -19,11 +19,14 @@ jobs:
|
|||||||
- name: Get dependencies
|
- name: Get dependencies
|
||||||
run: go mod tidy
|
run: go mod tidy
|
||||||
|
|
||||||
|
- name: Enable Debug Log
|
||||||
|
run: sed -i '' 's/false/true/g' config/global.go
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: go build -v ./...
|
run: go build -v ./...
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: sudo go test -ldflags "-X github.com/fumiama/WireGold/config.ShowDebugLog=true" $(go list ./...) # ip test needs sudo
|
run: sudo go test $(go list ./...) # ip test needs sudo
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
|
|||||||
@@ -448,7 +448,9 @@ func (conn *Conn) WriteToPeer(b []byte, ep p2p.EndPoint) (n int, err error) {
|
|||||||
return 0, errors.New("data size " + strconv.Itoa(len(b)) + " is too large")
|
return 0, errors.New("data size " + strconv.Itoa(len(b)) + " is too large")
|
||||||
}
|
}
|
||||||
if (!conn.suberr || len(conn.subs) > 0) && !conn.cplk.TryLock() {
|
if (!conn.suberr || len(conn.subs) > 0) && !conn.cplk.TryLock() {
|
||||||
logrus.Infoln("[tcp] try sub write")
|
if config.ShowDebugLog {
|
||||||
|
logrus.Debug("[tcp] try sub write to", tcpep)
|
||||||
|
}
|
||||||
n, err = conn.writeToPeer(b, tcpep, true) // try sub write
|
n, err = conn.writeToPeer(b, tcpep, true) // try sub write
|
||||||
if err == nil {
|
if err == nil {
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user