mirror of https://github.com/docker/docs.git
				
				
				
			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): | class Container(object): | ||||||
|     """ |     """ | ||||||
|  | @ -82,15 +84,19 @@ class Container(object): | ||||||
|         return out |         return out | ||||||
| 
 | 
 | ||||||
|     def start(self, **options): |     def start(self, **options): | ||||||
|  |         log.info("Starting %s..." % self.name) | ||||||
|         return self.client.start(self.id, **options) |         return self.client.start(self.id, **options) | ||||||
| 
 | 
 | ||||||
|     def stop(self): |     def stop(self): | ||||||
|  |         log.info("Stopping %s..." % self.name) | ||||||
|         return self.client.stop(self.id) |         return self.client.stop(self.id) | ||||||
| 
 | 
 | ||||||
|     def kill(self): |     def kill(self): | ||||||
|  |         log.info("Killing %s..." % self.name) | ||||||
|         return self.client.kill(self.id) |         return self.client.kill(self.id) | ||||||
| 
 | 
 | ||||||
|     def remove(self): |     def remove(self): | ||||||
|  |         log.info("Removing %s..." % self.name) | ||||||
|         return self.client.remove_container(self.id) |         return self.client.remove_container(self.id) | ||||||
| 
 | 
 | ||||||
|     def inspect_if_not_inspected(self): |     def inspect_if_not_inspected(self): | ||||||
|  |  | ||||||
|  | @ -92,7 +92,6 @@ class Service(object): | ||||||
|                 external_dir, internal_dir = volume.split(':') |                 external_dir, internal_dir = volume.split(':') | ||||||
|                 volume_bindings[os.path.abspath(external_dir)] = internal_dir |                 volume_bindings[os.path.abspath(external_dir)] = internal_dir | ||||||
| 
 | 
 | ||||||
|         log.info("Starting %s..." % container.name) |  | ||||||
|         container.start( |         container.start( | ||||||
|             links=self._get_links(), |             links=self._get_links(), | ||||||
|             port_bindings=port_bindings, |             port_bindings=port_bindings, | ||||||
|  | @ -102,7 +101,6 @@ class Service(object): | ||||||
| 
 | 
 | ||||||
|     def stop_container(self): |     def stop_container(self): | ||||||
|         container = self.containers()[-1] |         container = self.containers()[-1] | ||||||
|         log.info("Stopping and removing %s..." % container.name) |  | ||||||
|         container.kill() |         container.kill() | ||||||
|         container.remove() |         container.remove() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue