Merge pull request #1394 from michael-berlin/vtworker_rpc_log_always

vtworker: Log output of vtworker commands executed via RPC.
This commit is contained in:
Michael Berlin 2015-12-16 10:35:40 -08:00
Родитель 78f13a799c a4d1c3e629
Коммит 78447ad4cc
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -38,9 +38,12 @@ func (s *VtworkerServer) ExecuteVtworkerCommand(args *vtworkerdatapb.ExecuteVtwo
// (started in Instance.setAndStartWorker()) which has its own panic handler.
defer servenv.HandlePanic("vtworker", &err)
// create a logger, send the result back to the caller
// Stream everything back what the Wrangler is logging.
logstream := logutil.NewChannelLogger(10)
logger := logutil.NewTeeLogger(logstream, logutil.NewMemoryLogger())
// Let the Wrangler also log everything to the console (and thereby
// effectively to a logfile) to make sure that any information or errors
// is preserved in the logs in case the RPC or vtworker crashes.
logger := logutil.NewTeeLogger(logstream, logutil.NewConsoleLogger())
// send logs to the caller
wg := sync.WaitGroup{}