jdeathe/centos-ssh

Makefile logs improvements

Closed this issue · 0 comments

  • Add feature to allow the logs target to take [OPTIONS] to allow following, timestamps etc.
  • Add logsdef to handle deferred logs output within a target chain.
  • Deprecate logs-delayed; delayed isn't really the correct word to describe this target and it finally occurred to me that it should be "deferred".
  logs [OPTIONS]            Display log output from the container.
  logsdef                   Display log output from the container deferred for
                            STARTUP_TIME seconds. This will work in a chain
                            unlike the logs target.
  logs-delayed              [DEPRECATED] Replaced with logsdef.
logs: \
	_prerequisites \
	_require-docker-container
	@ $(docker) logs \
		$(filter-out $@, $(MAKECMDGOALS)) \
		$(DOCKER_NAME)
%:; @:

logsdef: \
	_prerequisites \
	_require-docker-container
	@ sleep $(STARTUP_TIME)
	@ $(MAKE) logs

logs-delayed: \
	logsdef