mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-01 01:44:15 +00:00
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:
parent
8320732743
commit
079d0bd8a9
291 changed files with 1837 additions and 2368 deletions
|
@ -1,10 +1,12 @@
|
|||
package conf
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
|
||||
"github.com/xtls/xray-core/app/dns/fakedns"
|
||||
"github.com/xtls/xray-core/common/errors"
|
||||
"github.com/xtls/xray-core/features/dns"
|
||||
)
|
||||
|
||||
|
@ -28,7 +30,7 @@ func (f *FakeDNSConfig) UnmarshalJSON(data []byte) error {
|
|||
case json.Unmarshal(data, &pools) == nil:
|
||||
f.pools = pools
|
||||
default:
|
||||
return newError("invalid fakedns config")
|
||||
return errors.New("invalid fakedns config")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -51,7 +53,7 @@ func (f *FakeDNSConfig) Build() (*fakedns.FakeDnsPoolMulti, error) {
|
|||
return &fakeDNSPool, nil
|
||||
}
|
||||
|
||||
return nil, newError("no valid FakeDNS config")
|
||||
return nil, errors.New("no valid FakeDNS config")
|
||||
}
|
||||
|
||||
type FakeDNSPostProcessingStage struct{}
|
||||
|
@ -122,7 +124,7 @@ func (FakeDNSPostProcessingStage) Process(config *Config) error {
|
|||
}
|
||||
}
|
||||
if !found {
|
||||
newError("Defined FakeDNS but haven't enabled FakeDNS destOverride at any inbound.").AtWarning().WriteToLog()
|
||||
errors.LogWarning(context.Background(), "Defined FakeDNS but haven't enabled FakeDNS destOverride at any inbound.")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue