func createErrAndLog(lg *common.Logger, val string, level common.Level) error { lg.Write(level, val+"\n") return errors.New(val) }