We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当你未给utils 设置log得时候, 接下去得log 输出 会调用到err.error错误: client, err := elastic.NewClient( elastic.SetURL(host), elastic.SetSniff(false), elastic.SetBasicAuth(user, password), //elastic.SetErrorLog(logger), //关闭log 提示:
)
那么在是这种条件判断和logger得输出得 会出错
if err != nil { logger.Error(err, logger.String(" some error occurred when check exists, index", index)) return false } if exists { logger.Error(errors.New(""), logger.String(" index:{%s} is already exists", index)) //2 return true } 在上面代码得2地方 其实err 为nil , 但是在logger 。error时候会强制用到err.error输出。 所以两个地方 || 得修改 要么在logger底层判断err 为nil 或者修改像我强制传递带指针得, 建议前者
The text was updated successfully, but these errors were encountered:
No branches or pull requests
当你未给utils 设置log得时候, 接下去得log 输出 会调用到err.error错误:
client, err := elastic.NewClient(
elastic.SetURL(host), elastic.SetSniff(false),
elastic.SetBasicAuth(user, password),
//elastic.SetErrorLog(logger), //关闭log 提示:
那么在是这种条件判断和logger得输出得 会出错
if err != nil {
logger.Error(err, logger.String(" some error occurred when check exists, index", index))
return false
}
if exists {
logger.Error(errors.New(""), logger.String(" index:{%s} is already exists", index)) //2
return true
}
在上面代码得2地方 其实err 为nil , 但是在logger 。error时候会强制用到err.error输出。
所以两个地方 || 得修改 要么在logger底层判断err 为nil 或者修改像我强制传递带指针得, 建议前者
The text was updated successfully, but these errors were encountered: