Пример #1
0
func loadMessage(db *daemondb.DaemonDB, key string, message proto.Message, owner hlog.LogOwner, op string) error {
	v, err := db.Get([]byte(key))
	if err != nil {
		hlog.HLog(ERROR, owner, 2, "failed to load %s: %v", op, err)
		return err
	}
	err = proto.Unmarshal(v, message)
	if err != nil {
		hlog.HLog(ERROR, owner, 2, "failed to unpack loaded %s: %v", op, err)
		return err
	}
	return nil
}
Пример #2
0
func saveMessage(db *daemondb.DaemonDB, key string, message proto.Message, owner hlog.LogOwner, op string) error {
	pm, err := proto.Marshal(message)
	if err != nil {
		hlog.HLog(ERROR, owner, 2, "failed to serialize %s: %v", op, err)
		return err
	}
	err = db.Update([]byte(key), pm)
	if err != nil {
		hlog.HLog(ERROR, owner, 2, "failed to write %s to db: %v", op, err)
		return err
	}
	hlog.HLog(DEBUG, owner, 2, "%s serialized to db", op)
	return nil
}
Пример #3
0
func (ctx *VmContext) Log(level hlog.LogLevel, args ...interface{}) {
	hlog.HLog(level, ctx, 1, args...)
}
Пример #4
0
func (cc *ContainerContext) Log(level hlog.LogLevel, args ...interface{}) {
	hlog.HLog(level, cc, 1, args...)
}
Пример #5
0
func (c *HyperConfig) Log(level hlog.LogLevel, args ...interface{}) {
	hlog.HLog(level, c, 1, args...)
}
Пример #6
0
func (e *Exec) Log(level hlog.LogLevel, args ...interface{}) {
	hlog.HLog(level, e, 1, args...)
}
Пример #7
0
func (inf *Interface) Log(level hlog.LogLevel, args ...interface{}) {
	hlog.HLog(level, inf, 1, args...)
}
Пример #8
0
// Log() employ `github.com/hyperhq/hypercontainer-utils/hlog.HLog` to add pod information to the log
func (p *XPod) Log(level hlog.LogLevel, args ...interface{}) {
	hlog.HLog(level, p, 1, args...)
}
Пример #9
0
func (v *Volume) Log(level hlog.LogLevel, args ...interface{}) {
	hlog.HLog(level, v, 1, args...)
}