本文整理汇总了Golang中github.com/keybase/client/go/logger.Logger.Errorf方法的典型用法代码示例。如果您正苦于以下问题:Golang Logger.Errorf方法的具体用法?Golang Logger.Errorf怎么用?Golang Logger.Errorf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/keybase/client/go/logger.Logger
的用法示例。
在下文中一共展示了Logger.Errorf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: NewContextWithOpID
// NewContextWithOpID adds a unique ID to this context, identifying
// a particular request.
func NewContextWithOpID(ctx context.Context,
log logger.Logger) context.Context {
if runtime.GOOS == "darwin" {
// Timeout operations before they hit the osxfuse time limit,
// so we don't hose the entire mount. The timeout is 60
// seconds, but it looks like sometimes it tries multiple
// attempts within that 60 seconds, so let's go a little under
// 60/3 to be safe.
ctx, _ = context.WithTimeout(ctx, 19*time.Second)
}
id, err := libkbfs.MakeRandomRequestID()
if err != nil {
log.Errorf("Couldn't make request ID: %v", err)
return ctx
}
return context.WithValue(ctx, CtxIDKey, id)
}
示例2: checkSystemUser
func checkSystemUser(log logger.Logger) {
if isAdminUser, match, _ := libkb.IsSystemAdminUser(); isAdminUser {
log.Errorf("Oops, you are trying to run as an admin user (%s). This isn't supported.", match)
os.Exit(int(keybase1.ExitCode_NOTOK))
}
}