@@ -22,6 +22,7 @@ import (
22
22
"github.com/docker/libcompose/docker/ctx"
23
23
"github.com/docker/libcompose/docker/image"
24
24
"github.com/docker/libcompose/labels"
25
+ "github.com/docker/libcompose/logger"
25
26
"github.com/docker/libcompose/project"
26
27
"github.com/docker/libcompose/project/events"
27
28
"github.com/docker/libcompose/project/options"
@@ -36,10 +37,8 @@ type Service struct {
36
37
project * project.Project
37
38
serviceConfig * config.ServiceConfig
38
39
clientFactory composeclient.Factory
40
+ loggerFactory logger.Factory
39
41
authLookup auth.Lookup
40
-
41
- // FIXME(vdemeester) remove this at some point
42
- context * ctx.Context
43
42
}
44
43
45
44
// NewService creates a service
@@ -50,7 +49,7 @@ func NewService(name string, serviceConfig *config.ServiceConfig, context *ctx.C
50
49
serviceConfig : serviceConfig ,
51
50
clientFactory : context .ClientFactory ,
52
51
authLookup : context .AuthLookup ,
53
- context : context ,
52
+ loggerFactory : context . LoggerFactory ,
54
53
}
55
54
}
56
55
@@ -199,7 +198,7 @@ func (s *Service) build(ctx context.Context, buildOptions options.Build) error {
199
198
NoCache : buildOptions .NoCache ,
200
199
ForceRemove : buildOptions .ForceRemove ,
201
200
Pull : buildOptions .Pull ,
202
- LoggerFactory : s .context . LoggerFactory ,
201
+ LoggerFactory : s .loggerFactory ,
203
202
}
204
203
return builder .Build (ctx , s .imageName ())
205
204
}
@@ -585,7 +584,7 @@ func (s *Service) Log(ctx context.Context, follow bool) error {
585
584
if s .Config ().ContainerName != "" {
586
585
name = s .Config ().ContainerName
587
586
}
588
- l := s .context . LoggerFactory .CreateContainerLogger (name )
587
+ l := s .loggerFactory .CreateContainerLogger (name )
589
588
return c .Log (ctx , l , follow )
590
589
})
591
590
}
0 commit comments