mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-09 23:34:26 +00:00
Show command in log
This commit is contained in:
parent
c1ccfdd859
commit
8f95182392
4
main.go
4
main.go
@ -3,8 +3,10 @@ package main
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/codegangsta/cli"
|
"github.com/codegangsta/cli"
|
||||||
@ -93,6 +95,8 @@ func main() {
|
|||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
gCtx, gCancel := 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)
|
errs := make(chan error, 1)
|
||||||
go func() {
|
go func() {
|
||||||
errs <- srv.Run(ctx, server.WithGracefullContext(gCtx))
|
errs <- srv.Run(ctx, server.WithGracefullContext(gCtx))
|
||||||
|
@ -107,7 +107,7 @@ func (server *Server) Run(ctx context.Context, options ...RunOption) error {
|
|||||||
return errors.Wrapf(err, "failed to setup an HTTP server")
|
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" {
|
if server.options.Address == "0.0.0.0" {
|
||||||
for _, address := range listAddresses() {
|
for _, address := range listAddresses() {
|
||||||
log.Printf("Alternative URL: %s", server.setupURL(address, path).String())
|
log.Printf("Alternative URL: %s", server.setupURL(address, path).String())
|
||||||
|
Loading…
Reference in New Issue
Block a user