Skip to content

Commit

Permalink
Updated and fixed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode committed Dec 17, 2015
1 parent c511d1d commit a06ce42
Show file tree
Hide file tree
Showing 70 changed files with 901 additions and 20,397 deletions.
24 changes: 6 additions & 18 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions server.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package main

import (
authlib "github.com/clawio/service-auth/lib"
pb "github.com/clawio/service-localfs-meta/proto/metadata"
proppb "github.com/clawio/service-localfs-meta/proto/propagator"
authlib "github.com/clawio/service.auth/lib"
rus "github.com/sirupsen/logrus"
"golang.org/x/net/context"
"google.golang.org/grpc"
Expand Down Expand Up @@ -73,11 +73,11 @@ func (s *server) Home(ctx context.Context, req *pb.HomeReq) (*pb.Void, error) {

home := getHome(idt)

log.Infof("home is %s", home)
log.Infof("user home is %s", home)

pp := s.getPhysicalPath(home)

log.Infof("physical path is %s", pp)
log.Infof("user physical home is %s", pp)

con, err := grpc.Dial(s.p.prop, grpc.WithInsecure())
if err != nil {
Expand All @@ -86,7 +86,7 @@ func (s *server) Home(ctx context.Context, req *pb.HomeReq) (*pb.Void, error) {
}
defer con.Close()

log.Infof("created connection to prop")
log.Infof("created connection to %s", s.p.prop)

client := proppb.NewPropClient(con)

Expand All @@ -95,15 +95,15 @@ func (s *server) Home(ctx context.Context, req *pb.HomeReq) (*pb.Void, error) {
// Create home dir if not exists
if os.IsNotExist(err) {

log.Infof("home does not exist")
log.Infof("user physical home %s does not exist", pp)

err = os.MkdirAll(pp, dirPerm)
if err != nil {
log.Error(err)
return &pb.Void{}, err
}

log.Infof("home created at %s", pp)
log.Infof("user physical home created at %s", pp)

in := &proppb.GetReq{}
in.Path = home
Expand All @@ -115,7 +115,7 @@ func (s *server) Home(ctx context.Context, req *pb.HomeReq) (*pb.Void, error) {
return &pb.Void{}, nil
}

log.Info("home putted into prop")
log.Info("home saved to %s", s.p.prop)

return &pb.Void{}, nil
}
Expand All @@ -125,7 +125,7 @@ func (s *server) Home(ctx context.Context, req *pb.HomeReq) (*pb.Void, error) {
return &pb.Void{}, err
}

log.Infof("home at %s already created")
log.Infof("user physical home at %s already created")

in := &proppb.GetReq{}
in.Path = home
Expand All @@ -137,8 +137,6 @@ func (s *server) Home(ctx context.Context, req *pb.HomeReq) (*pb.Void, error) {
return &pb.Void{}, nil
}

log.Infof("home is in prop")

return &pb.Void{}, nil
}

Expand Down
Binary file added service-localfs-meta
Binary file not shown.
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"code.google.com/p/go-uuid/uuid"
"github.com/clawio/service.auth/lib"
"github.com/clawio/service-auth/lib"
"golang.org/x/net/context"
metadata "google.golang.org/grpc/metadata"
"io"
Expand Down
Loading

0 comments on commit a06ce42

Please sign in to comment.