Commit 337f0cb4 authored by suyanlong's avatar suyanlong

1、remove unused config information.

2、update makefile and update README.md.
parent 39f07654
Pipeline #8304 canceled with stages
...@@ -43,6 +43,7 @@ build: packr ...@@ -43,6 +43,7 @@ build: packr
rm -f imports/imports.go rm -f imports/imports.go
$(GO) build -tags=go_json -ldflags '${GOLDFLAGS}' ./cmd/${APP_NAME} $(GO) build -tags=go_json -ldflags '${GOLDFLAGS}' ./cmd/${APP_NAME}
@mv ./sidecar bin @mv ./sidecar bin
@cp ./config/authz_* bin/
@printf "${GREEN}Build sidecar successfully!${NC}\n" @printf "${GREEN}Build sidecar successfully!${NC}\n"
.PHONY: test fmt_proto fmt_shell check checkgofmt .PHONY: test fmt_proto fmt_shell check checkgofmt
...@@ -151,6 +152,7 @@ grpc: ...@@ -151,6 +152,7 @@ grpc:
clean: clean:
@go clean @go clean
@rm -rf bin
build-dep: build-dep:
@go install golang.org/x/tools/cmd/goimports@latest @go install golang.org/x/tools/cmd/goimports@latest
......
...@@ -84,15 +84,13 @@ filename = "sidecar.log" ...@@ -84,15 +84,13 @@ filename = "sidecar.log"
report_caller = false report_caller = false
[log.module] [log.module]
app = "info"
manager = "info"
api_server = "info" api_server = "info"
appchain_mgr = "info" appchain_mgr = "info"
bxh_lite = "info" rule_mgr = "info"
executor = "info"
exchanger = "info"
monitor = "info"
peer_mgr = "info" peer_mgr = "info"
router = "info" router = "info"
rule_mgr = "info"
swarm = "info" swarm = "info"
syncer = "info" syncer = "info"
......
...@@ -11,15 +11,13 @@ filename = "sidecar.log" ...@@ -11,15 +11,13 @@ filename = "sidecar.log"
report_caller = false report_caller = false
[log.module] [log.module]
app = "info"
manager = "info"
api_server = "info" api_server = "info"
appchain_mgr = "info" appchain_mgr = "info"
bxh_lite = "info" rule_mgr = "info"
executor = "info"
exchanger = "info"
monitor = "info"
peer_mgr = "info" peer_mgr = "info"
router = "info" router = "info"
rule_mgr = "info"
swarm = "info" swarm = "info"
syncer = "info" syncer = "info"
......
...@@ -66,7 +66,7 @@ func NewSidecar(repoRoot string, config *repo.Config) (internal.Launcher, error) ...@@ -66,7 +66,7 @@ func NewSidecar(repoRoot string, config *repo.Config) (internal.Launcher, error)
cryptor := txcrypto.NewCryptor(nil, appchainMgr, privateKey) cryptor := txcrypto.NewCryptor(nil, appchainMgr, privateKey)
clientPort := appchain.NewPorts(clients, cryptor, logger) clientPort := appchain.NewPorts(clients, cryptor, logger)
r.Adds(clientPort) r.Adds(clientPort)
rule, err := rulemgr.New(store, loggers.Logger(loggers.Rule)) rule, err := rulemgr.New(store, loggers.Logger(loggers.RuleMgr))
tool.Asset(err) tool.Asset(err)
mg, err := manager.NewManager(addr.String(), pm, appchainMgr, rule, loggers.Logger(loggers.Manager)) mg, err := manager.NewManager(addr.String(), pm, appchainMgr, rule, loggers.Logger(loggers.Manager))
tool.Asset(err) tool.Asset(err)
......
...@@ -17,7 +17,6 @@ func TestLogger(t *testing.T) { ...@@ -17,7 +17,6 @@ func TestLogger(t *testing.T) {
Level: "info", Level: "info",
Module: repo.LogModule{ Module: repo.LogModule{
AppchainMgr: "info", AppchainMgr: "info",
Exchanger: "info",
Executor: "info", Executor: "info",
App: "info", App: "info",
Monitor: "info", Monitor: "info",
...@@ -26,7 +25,7 @@ func TestLogger(t *testing.T) { ...@@ -26,7 +25,7 @@ func TestLogger(t *testing.T) {
PeerMgr: "info", PeerMgr: "info",
Router: "info", Router: "info",
ApiServer: "info", ApiServer: "info",
Manger: "info", Manager: "info",
}, },
}, },
} }
......
...@@ -10,16 +10,13 @@ import ( ...@@ -10,16 +10,13 @@ import (
const ( const (
ApiServer = "api_server" ApiServer = "api_server"
App = "app" App = "app"
Manager = "manager"
RuleMgr = "rule_mgr"
AppchainMgr = "appchain_mgr" AppchainMgr = "appchain_mgr"
Executor = "executor"
Exchanger = "exchanger"
Monitor = "monitor"
PeerMgr = "peer_mgr" PeerMgr = "peer_mgr"
Router = "router" Router = "router"
Swarm = "swarm" Swarm = "swarm"
Syncer = "syncer" Syncer = "syncer"
Manager = "manager"
Rule = "rule"
) )
var w *loggerWrapper var w *loggerWrapper
...@@ -36,12 +33,6 @@ func InitializeLogger(config *repo.Config) { ...@@ -36,12 +33,6 @@ func InitializeLogger(config *repo.Config) {
m[App].Logger.SetLevel(log.ParseLevel(config.Log.Level)) m[App].Logger.SetLevel(log.ParseLevel(config.Log.Level))
m[AppchainMgr] = log.NewWithModule(AppchainMgr) m[AppchainMgr] = log.NewWithModule(AppchainMgr)
m[AppchainMgr].Logger.SetLevel(log.ParseLevel(config.Log.Module.AppchainMgr)) m[AppchainMgr].Logger.SetLevel(log.ParseLevel(config.Log.Module.AppchainMgr))
m[Exchanger] = log.NewWithModule(Exchanger)
m[Exchanger].Logger.SetLevel(log.ParseLevel(config.Log.Module.Exchanger))
m[Executor] = log.NewWithModule(Executor)
m[Executor].Logger.SetLevel(log.ParseLevel(config.Log.Module.Executor))
m[Monitor] = log.NewWithModule(Monitor)
m[Monitor].Logger.SetLevel(log.ParseLevel(config.Log.Module.Monitor))
m[Router] = log.NewWithModule(Router) m[Router] = log.NewWithModule(Router)
m[Router].Logger.SetLevel(log.ParseLevel(config.Log.Module.Router)) m[Router].Logger.SetLevel(log.ParseLevel(config.Log.Module.Router))
m[Swarm] = log.NewWithModule(Swarm) m[Swarm] = log.NewWithModule(Swarm)
...@@ -51,9 +42,9 @@ func InitializeLogger(config *repo.Config) { ...@@ -51,9 +42,9 @@ func InitializeLogger(config *repo.Config) {
m[PeerMgr] = log.NewWithModule(PeerMgr) m[PeerMgr] = log.NewWithModule(PeerMgr)
m[PeerMgr].Logger.SetLevel(log.ParseLevel(config.Log.Module.PeerMgr)) m[PeerMgr].Logger.SetLevel(log.ParseLevel(config.Log.Module.PeerMgr))
m[Manager] = log.NewWithModule(Manager) m[Manager] = log.NewWithModule(Manager)
m[Manager].Logger.SetLevel(log.ParseLevel(config.Log.Module.Manger)) m[Manager].Logger.SetLevel(log.ParseLevel(config.Log.Module.Manager))
m[Rule] = log.NewWithModule(Rule) m[RuleMgr] = log.NewWithModule(RuleMgr)
m[Rule].Logger.SetLevel(log.ParseLevel(config.Log.Module.Rule)) m[RuleMgr].Logger.SetLevel(log.ParseLevel(config.Log.Module.Rule))
w = &loggerWrapper{loggers: m} w = &loggerWrapper{loggers: m}
} }
......
...@@ -66,7 +66,7 @@ type LogModule struct { ...@@ -66,7 +66,7 @@ type LogModule struct {
Router string `toml:"router" json:"router" json:"router,omitempty"` Router string `toml:"router" json:"router" json:"router,omitempty"`
Swarm string `toml:"swarm" json:"swarm" json:"swarm,omitempty"` Swarm string `toml:"swarm" json:"swarm" json:"swarm,omitempty"`
Syncer string `toml:"syncer" json:"syncer" json:"syncer,omitempty"` Syncer string `toml:"syncer" json:"syncer" json:"syncer,omitempty"`
Manger string `toml:"manager" json:"manager" json:"manager,omitempty"` Manager string `toml:"manager" json:"manager" json:"manager,omitempty"`
Rule string `toml:"rule" json:"rule" json:"rule,omitempty"` Rule string `toml:"rule" json:"rule" json:"rule,omitempty"`
} }
...@@ -94,15 +94,15 @@ func DefaultConfig() *Config { ...@@ -94,15 +94,15 @@ func DefaultConfig() *Config {
ReportCaller: false, ReportCaller: false,
Level: "info", Level: "info",
Module: LogModule{ Module: LogModule{
App: "info",
Manager: "info",
ApiServer: "info",
AppchainMgr: "info", AppchainMgr: "info",
Exchanger: "info", Rule: "info",
Executor: "info",
Monitor: "info",
Swarm: "info",
Syncer: "info",
PeerMgr: "info", PeerMgr: "info",
Router: "info", Router: "info",
ApiServer: "info", Swarm: "info",
Syncer: "info",
}, },
}, },
Peer: Peer{ Peer: Peer{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment