mirror of
https://github.com/docker/compose.git
synced 2025-04-08 17:05:13 +02:00
Move log messages to container
This commit is contained in:
parent
5a46278f79
commit
bdf99cd443
@ -1,4 +1,6 @@
|
||||
import logging
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
class Container(object):
|
||||
"""
|
||||
@ -82,15 +84,19 @@ class Container(object):
|
||||
return out
|
||||
|
||||
def start(self, **options):
|
||||
log.info("Starting %s..." % self.name)
|
||||
return self.client.start(self.id, **options)
|
||||
|
||||
def stop(self):
|
||||
log.info("Stopping %s..." % self.name)
|
||||
return self.client.stop(self.id)
|
||||
|
||||
def kill(self):
|
||||
log.info("Killing %s..." % self.name)
|
||||
return self.client.kill(self.id)
|
||||
|
||||
def remove(self):
|
||||
log.info("Removing %s..." % self.name)
|
||||
return self.client.remove_container(self.id)
|
||||
|
||||
def inspect_if_not_inspected(self):
|
||||
|
@ -92,7 +92,6 @@ class Service(object):
|
||||
external_dir, internal_dir = volume.split(':')
|
||||
volume_bindings[os.path.abspath(external_dir)] = internal_dir
|
||||
|
||||
log.info("Starting %s..." % container.name)
|
||||
container.start(
|
||||
links=self._get_links(),
|
||||
port_bindings=port_bindings,
|
||||
@ -102,7 +101,6 @@ class Service(object):
|
||||
|
||||
def stop_container(self):
|
||||
container = self.containers()[-1]
|
||||
log.info("Stopping and removing %s..." % container.name)
|
||||
container.kill()
|
||||
container.remove()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user