Refactor log (#3446)

* Refactor log

* Add new log methods

* Fix logger test

* Change all logging code

* Clean up pathObj

* Rebase to latest main

* Remove invoking method name after the dot
This commit is contained in:
yuhan6665 2024-06-29 14:32:57 -04:00 committed by GitHub
parent 8320732743
commit 079d0bd8a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
291 changed files with 1837 additions and 2368 deletions

View file

@ -5,6 +5,7 @@ import (
"net"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/errors"
)
type PacketHeader interface {
@ -20,7 +21,7 @@ func CreatePacketHeader(config interface{}) (PacketHeader, error) {
if h, ok := header.(PacketHeader); ok {
return h, nil
}
return nil, newError("not a packet header")
return nil, errors.New("not a packet header")
}
type ConnectionAuthenticator interface {
@ -36,5 +37,5 @@ func CreateConnectionAuthenticator(config interface{}) (ConnectionAuthenticator,
if a, ok := auth.(ConnectionAuthenticator); ok {
return a, nil
}
return nil, newError("not a ConnectionAuthenticator")
return nil, errors.New("not a ConnectionAuthenticator")
}