本文整理匯總了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))
}
}