파일에 직접 로깅하는 로거로 교체
This commit is contained in:
@ -6,7 +6,6 @@ import (
|
||||
"net"
|
||||
"os"
|
||||
|
||||
"repositories.action2quare.com/ayo/gocommon/logger"
|
||||
"repositories.action2quare.com/ayo/houston/shared"
|
||||
"repositories.action2quare.com/ayo/houston/shared/protos"
|
||||
|
||||
@ -110,7 +109,7 @@ type Operation interface {
|
||||
func loadServerConfig() serverConfig {
|
||||
configFile, err := os.Open("config.json")
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
shared.Logger().Println(err)
|
||||
return serverConfig{
|
||||
GrpcPort: 8080,
|
||||
}
|
||||
@ -126,14 +125,14 @@ func loadServerConfig() serverConfig {
|
||||
dec := json.NewDecoder(configFile)
|
||||
err = dec.Decode(&config)
|
||||
if err != nil {
|
||||
logger.Error(err)
|
||||
shared.Logger().Println(err)
|
||||
return serverConfig{
|
||||
GrpcPort: 8080,
|
||||
}
|
||||
}
|
||||
|
||||
if config.Houston == nil {
|
||||
logger.Error(`"houston" object is missing in config.json`)
|
||||
shared.Logger().Println(`"houston" object is missing in config.json`)
|
||||
return serverConfig{
|
||||
GrpcPort: 8080,
|
||||
}
|
||||
@ -167,7 +166,7 @@ type houstonServer struct {
|
||||
}
|
||||
|
||||
func (hs *houstonServer) Start() error {
|
||||
logger.Println("houston server is started at port", hs.port)
|
||||
shared.Logger().Println("houston server is started at port", hs.port)
|
||||
lis, err := net.Listen("tcp", fmt.Sprintf("0.0.0.0:%d", hs.port))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user