Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sidecar
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
sidecar
Commits
337f0cb4
Commit
337f0cb4
authored
Nov 26, 2021
by
suyanlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、remove unused config information.
2、update makefile and update README.md.
parent
39f07654
Pipeline
#8304
canceled with stages
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
22 additions
and
34 deletions
+22
-34
Makefile
Makefile
+2
-0
README.md
README.md
+3
-5
sidecar.toml
config/sidecar.toml
+3
-5
sidecar.go
internal/app/sidecar.go
+1
-1
logger_test.go
internal/loggers/logger_test.go
+1
-2
loggers.go
internal/loggers/loggers.go
+5
-14
config.go
internal/repo/config.go
+7
-7
No files found.
Makefile
View file @
337f0cb4
...
...
@@ -43,6 +43,7 @@ build: packr
rm
-f
imports/imports.go
$(GO)
build
-tags
=
go_json
-ldflags
'${GOLDFLAGS}'
./cmd/
${
APP_NAME
}
@
mv
./sidecar bin
@
cp
./config/authz_
*
bin/
@
printf
"
${
GREEN
}
Build sidecar successfully!
${
NC
}
\n
"
.PHONY
:
test fmt_proto fmt_shell check checkgofmt
...
...
@@ -151,6 +152,7 @@ grpc:
clean
:
@
go clean
@
rm
-rf
bin
build-dep
:
@
go
install
golang.org/x/tools/cmd/goimports@latest
...
...
README.md
View file @
337f0cb4
...
...
@@ -84,15 +84,13 @@ filename = "sidecar.log"
report_caller
=
false
[log.module]
app
=
"info"
manager
=
"info"
api_server
=
"info"
appchain_mgr
=
"info"
bxh_lite
=
"info"
executor
=
"info"
exchanger
=
"info"
monitor
=
"info"
rule_mgr
=
"info"
peer_mgr
=
"info"
router
=
"info"
rule_mgr
=
"info"
swarm
=
"info"
syncer
=
"info"
...
...
config/sidecar.toml
View file @
337f0cb4
...
...
@@ -11,15 +11,13 @@ filename = "sidecar.log"
report_caller
=
false
[log.module]
app
=
"info"
manager
=
"info"
api_server
=
"info"
appchain_mgr
=
"info"
bxh_lite
=
"info"
executor
=
"info"
exchanger
=
"info"
monitor
=
"info"
rule_mgr
=
"info"
peer_mgr
=
"info"
router
=
"info"
rule_mgr
=
"info"
swarm
=
"info"
syncer
=
"info"
...
...
internal/app/sidecar.go
View file @
337f0cb4
...
...
@@ -66,7 +66,7 @@ func NewSidecar(repoRoot string, config *repo.Config) (internal.Launcher, error)
cryptor
:=
txcrypto
.
NewCryptor
(
nil
,
appchainMgr
,
privateKey
)
clientPort
:=
appchain
.
NewPorts
(
clients
,
cryptor
,
logger
)
r
.
Adds
(
clientPort
)
rule
,
err
:=
rulemgr
.
New
(
store
,
loggers
.
Logger
(
loggers
.
Rule
))
rule
,
err
:=
rulemgr
.
New
(
store
,
loggers
.
Logger
(
loggers
.
Rule
Mgr
))
tool
.
Asset
(
err
)
mg
,
err
:=
manager
.
NewManager
(
addr
.
String
(),
pm
,
appchainMgr
,
rule
,
loggers
.
Logger
(
loggers
.
Manager
))
tool
.
Asset
(
err
)
...
...
internal/loggers/logger_test.go
View file @
337f0cb4
...
...
@@ -17,7 +17,6 @@ func TestLogger(t *testing.T) {
Level
:
"info"
,
Module
:
repo
.
LogModule
{
AppchainMgr
:
"info"
,
Exchanger
:
"info"
,
Executor
:
"info"
,
App
:
"info"
,
Monitor
:
"info"
,
...
...
@@ -26,7 +25,7 @@ func TestLogger(t *testing.T) {
PeerMgr
:
"info"
,
Router
:
"info"
,
ApiServer
:
"info"
,
Man
ger
:
"info"
,
Man
ager
:
"info"
,
},
},
}
...
...
internal/loggers/loggers.go
View file @
337f0cb4
...
...
@@ -10,16 +10,13 @@ import (
const
(
ApiServer
=
"api_server"
App
=
"app"
Manager
=
"manager"
RuleMgr
=
"rule_mgr"
AppchainMgr
=
"appchain_mgr"
Executor
=
"executor"
Exchanger
=
"exchanger"
Monitor
=
"monitor"
PeerMgr
=
"peer_mgr"
Router
=
"router"
Swarm
=
"swarm"
Syncer
=
"syncer"
Manager
=
"manager"
Rule
=
"rule"
)
var
w
*
loggerWrapper
...
...
@@ -36,12 +33,6 @@ func InitializeLogger(config *repo.Config) {
m
[
App
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Level
))
m
[
AppchainMgr
]
=
log
.
NewWithModule
(
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
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Router
))
m
[
Swarm
]
=
log
.
NewWithModule
(
Swarm
)
...
...
@@ -51,9 +42,9 @@ func InitializeLogger(config *repo.Config) {
m
[
PeerMgr
]
=
log
.
NewWithModule
(
PeerMgr
)
m
[
PeerMgr
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
PeerMgr
))
m
[
Manager
]
=
log
.
NewWithModule
(
Manager
)
m
[
Manager
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Manger
))
m
[
Rule
]
=
log
.
NewWithModule
(
Rule
)
m
[
Rule
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Rule
))
m
[
Manager
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Man
a
ger
))
m
[
Rule
Mgr
]
=
log
.
NewWithModule
(
RuleMgr
)
m
[
Rule
Mgr
]
.
Logger
.
SetLevel
(
log
.
ParseLevel
(
config
.
Log
.
Module
.
Rule
))
w
=
&
loggerWrapper
{
loggers
:
m
}
}
...
...
internal/repo/config.go
View file @
337f0cb4
...
...
@@ -66,7 +66,7 @@ type LogModule struct {
Router
string
`toml:"router" json:"router" json:"router,omitempty"`
Swarm
string
`toml:"swarm" json:"swarm" json:"swarm,omitempty"`
Syncer
string
`toml:"syncer" json:"syncer" json:"syncer,omitempty"`
Man
ger
string
`toml:"manager" json:"manager" json:"manager,omitempty"`
Man
ager
string
`toml:"manager" json:"manager" json:"manager,omitempty"`
Rule
string
`toml:"rule" json:"rule" json:"rule,omitempty"`
}
...
...
@@ -94,15 +94,15 @@ func DefaultConfig() *Config {
ReportCaller
:
false
,
Level
:
"info"
,
Module
:
LogModule
{
App
:
"info"
,
Manager
:
"info"
,
ApiServer
:
"info"
,
AppchainMgr
:
"info"
,
Exchanger
:
"info"
,
Executor
:
"info"
,
Monitor
:
"info"
,
Swarm
:
"info"
,
Syncer
:
"info"
,
Rule
:
"info"
,
PeerMgr
:
"info"
,
Router
:
"info"
,
ApiServer
:
"info"
,
Swarm
:
"info"
,
Syncer
:
"info"
,
},
},
Peer
:
Peer
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment