2020-08-10 14:28:42 +00:00
|
|
|
from ._utils import SubCommand, DockerProgram
|
2020-08-08 17:41:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
class LogsCommand(SubCommand):
|
2020-08-10 13:48:15 +00:00
|
|
|
def __init__(self):
|
|
|
|
super().__init__(
|
|
|
|
'logs',
|
2020-08-10 09:24:39 +00:00
|
|
|
description="Show logs of a project"
|
|
|
|
)
|
2020-08-08 17:41:11 +00:00
|
|
|
|
2020-08-10 13:48:15 +00:00
|
|
|
def run(self):
|
2020-08-10 14:28:42 +00:00
|
|
|
DockerProgram('docker-compose').run(
|
|
|
|
['logs', '-tf', '--tail=10'],
|
|
|
|
cwd='hello-world.project',
|
|
|
|
env={'COMPOSE_PROJECT_NAME': 'hello-world'}
|
|
|
|
)
|