logs-fix
This commit is contained in:
parent
baeb5a68ea
commit
78930dc8f3
|
@ -27,23 +27,24 @@ func main() {
|
||||||
cli.ARG_REDIS_URL = flag.String("redis_url", "", "Redis connection string")
|
cli.ARG_REDIS_URL = flag.String("redis_url", "", "Redis connection string")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
// global log level
|
|
||||||
logrus.SetFormatter(&logs.LogTextFormatter{})
|
|
||||||
|
|
||||||
constants.VERSION = VERSION
|
constants.VERSION = VERSION
|
||||||
|
|
||||||
|
// initialize logrus
|
||||||
|
log := logs.InitLog(refs.StringValue(cli.ARG_LOG_LEVEL))
|
||||||
|
|
||||||
|
// set logrus formatter
|
||||||
|
log.SetFormatter(&logs.LogTextFormatter{})
|
||||||
|
|
||||||
// initialize required envs (mainly db, env file path and redis)
|
// initialize required envs (mainly db, env file path and redis)
|
||||||
err := memorystore.InitRequiredEnv()
|
err := memorystore.InitRequiredEnv()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Fatal("Error while initializing required envs: ", err)
|
log.Fatal("Error while initializing required envs: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
log := logs.InitLog(refs.StringValue(cli.ARG_LOG_LEVEL))
|
// initialize required envs (mainly db, env file path and redis)
|
||||||
|
err := memorystore.InitRequiredEnv()
|
||||||
// initialize memory store
|
|
||||||
err = memorystore.InitMemStore()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error while initializing memory store: ", err)
|
log.Fatal("Error while initializing required envs: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize db provider
|
// initialize db provider
|
||||||
|
|
|
@ -321,7 +321,7 @@ func LoginResolver(ctx context.Context, params model.LoginInput) (*model.AuthRes
|
||||||
// Assign the combined data to the provided pointer
|
// Assign the combined data to the provided pointer
|
||||||
user.AppData = &appData
|
user.AppData = &appData
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Error getting author's redis cache: %v", err)
|
log.Errorf("Error getting author's redis cache: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
res = &model.AuthResponse{
|
res = &model.AuthResponse{
|
||||||
|
|
|
@ -95,7 +95,7 @@ func SessionResolver(ctx context.Context, params *model.SessionQueryInput) (*mod
|
||||||
// Assign the combined data to the provided pointer
|
// Assign the combined data to the provided pointer
|
||||||
user.AppData = &appData
|
user.AppData = &appData
|
||||||
} else {
|
} else {
|
||||||
log.Printf("Error getting author's redis cache: %v", err)
|
log.Errorf("Error getting author's redis cache: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
res = &model.AuthResponse{
|
res = &model.AuthResponse{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user