From 8f95182392d27d2ce48cb5d9c238186db90395e6 Mon Sep 17 00:00:00 2001 From: Iwasaki Yudai Date: Tue, 22 Aug 2017 12:11:11 +0900 Subject: [PATCH] Show command in log --- main.go | 4 ++++ server/server.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index deb5171..b6290be 100644 --- a/main.go +++ b/main.go @@ -3,8 +3,10 @@ package main import ( "context" "fmt" + "log" "os" "os/signal" + "strings" "syscall" "github.com/codegangsta/cli" @@ -93,6 +95,8 @@ func main() { ctx, cancel := context.WithCancel(context.Background()) gCtx, gCancel := context.WithCancel(context.Background()) + log.Printf("GoTTY is starting with command: %s", strings.Join(args, " ")) + errs := make(chan error, 1) go func() { errs <- srv.Run(ctx, server.WithGracefullContext(gCtx)) diff --git a/server/server.go b/server/server.go index 6c0fafb..bb03bcf 100644 --- a/server/server.go +++ b/server/server.go @@ -107,7 +107,7 @@ func (server *Server) Run(ctx context.Context, options ...RunOption) error { return errors.Wrapf(err, "failed to setup an HTTP server") } - log.Printf("GoTTY server is starting at: %s", url.String()) + log.Printf("HTTP server is listening at: %s", url.String()) if server.options.Address == "0.0.0.0" { for _, address := range listAddresses() { log.Printf("Alternative URL: %s", server.setupURL(address, path).String())