本文整理匯總了Golang中github.com/Sirupsen/logrus.Entry.Warn方法的典型用法代碼示例。如果您正苦於以下問題:Golang Entry.Warn方法的具體用法?Golang Entry.Warn怎麽用?Golang Entry.Warn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/Sirupsen/logrus.Entry
的用法示例。
在下文中一共展示了Entry.Warn方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: handleApiEvents
func handleApiEvents(logContext *logrus.Entry, client string, events []*omaha.Event) error {
for _, event := range events {
evType, err := strconv.Atoi(event.Type)
if err != nil {
return err
}
evResult, err := strconv.Atoi(event.Result)
if err != nil {
return err
}
err = db.LogEvent(client, evType, evResult)
if err != nil {
logContext.Error(err)
}
switch evType {
case eventTypeDownload:
logContext.Info("Client is downloading new version.")
case eventTypeArrive:
logContext.Info("Client finished download.")
case eventTypeApply:
switch evResult {
case eventResultOK:
logContext.Info("Client applied package.")
case eventResultError:
logContext.Info("Client errored during update.")
case eventResultDone:
logContext.Info("Client upgraded to current version.")
}
case eventTypeSuccess:
logContext.Info("Install success. Update completion prevented by instance.")
default:
logContext.Warn("Unknown event type %v.", evType)
}
}
return nil
}
示例2: GetUpdates
func GetUpdates(c *gin.Context, d *GetUpdatesCommand, q *NuGetQuery, logger *log.Entry) {
logger.Warn("GetUpdates not implemented")
c.Status(501)
}