From 02ddaad5d985186eed94dea4105a57fa21ba24db Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Sun, 27 Oct 2013 07:06:43 +0000 Subject: [PATCH] Engine: optional environment variable 'Logging' in 'serveapi' --- docker/docker.go | 4 +++- server.go | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/docker.go b/docker/docker.go index 2fc864adf4..e58bd40013 100644 --- a/docker/docker.go +++ b/docker/docker.go @@ -86,7 +86,9 @@ func main() { log.Fatal(err) } // Serve api - if err := eng.Job("serveapi", flHosts...).Run(); err != nil { + job := eng.Job("serveapi", flHosts...) + job.Setenv("Logging", true) + if err := job.Run(); err != nil { log.Fatal(err) } } else { diff --git a/server.go b/server.go index 72ad39cdce..c041491ead 100644 --- a/server.go +++ b/server.go @@ -88,7 +88,8 @@ func (srv *Server) ListenAndServe(job *engine.Job) string { return "Invalid protocol format." } go func() { - chErrors <- ListenAndServe(protoAddrParts[0], protoAddrParts[1], srv, true) + // FIXME: merge Server.ListenAndServe with ListenAndServe + chErrors <- ListenAndServe(protoAddrParts[0], protoAddrParts[1], srv, job.GetenvBool("Logging")) }() } for i := 0; i < len(protoAddrs); i += 1 {