2020-08-08 17:41:11 +00:00
|
|
|
from ..core import Parser
|
|
|
|
|
|
|
|
from ._utils import SubCommand, Docker
|
|
|
|
|
|
|
|
|
|
|
|
class LogsCommand(SubCommand):
|
2020-08-10 09:24:39 +00:00
|
|
|
command = 'logs'
|
2020-08-08 17:41:11 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def setup(cls):
|
2020-08-10 09:24:39 +00:00
|
|
|
parser = Parser.get_subparsers().add_parser(
|
|
|
|
cls.command,
|
|
|
|
description="Show logs of a project"
|
|
|
|
)
|
2020-08-08 17:41:11 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def run(cls):
|
|
|
|
print(Docker.run_command('docker-compose', ['logs', '-tf', '--tail=10'], cwd='hello-world.project', env={'COMPOSE_PROJECT_NAME': 'hello-world'}))
|