add debug flag to server

main
Ben Grewell 3 years ago
parent 08168a8e51
commit b680d5a133

@ -6,7 +6,7 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="fc2840de-29dc-4fca-8e0e-a283562f60ca" name="Default Changelist" comment=""> <list default="true" id="fc2840de-29dc-4fca-8e0e-a283562f60ca" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/client.go" beforeDir="false" afterPath="$PROJECT_DIR$/client.go" afterDir="false" /> <change beforePath="$PROJECT_DIR$/server.go" beforeDir="false" afterPath="$PROJECT_DIR$/server.go" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

@ -42,6 +42,7 @@ type Server struct {
Running bool `json:"running" yaml:"running" xml:"running"` Running bool `json:"running" yaml:"running" xml:"running"`
Options *ServerOptions `json:"-" yaml:"-" xml:"-"` Options *ServerOptions `json:"-" yaml:"-" xml:"-"`
ExitCode *int `json:"exit_code" yaml:"exit_code" xml:"exit_code"` ExitCode *int `json:"exit_code" yaml:"exit_code" xml:"exit_code"`
Debug bool `json:"-" yaml:"-" xml:"-"`
outputStream io.ReadCloser `json:"output_stream" yaml:"output_stream" xml:"output_stream"` outputStream io.ReadCloser `json:"output_stream" yaml:"output_stream" xml:"output_stream"`
errorStream io.ReadCloser `json:"error_stream" yaml:"error_stream" xml:"error_stream"` errorStream io.ReadCloser `json:"error_stream" yaml:"error_stream" xml:"error_stream"`
cancel context.CancelFunc `json:"cancel" yaml:"cancel" xml:"cancel"` cancel context.CancelFunc `json:"cancel" yaml:"cancel" xml:"cancel"`
@ -160,11 +161,11 @@ func (s *Server) Start() (err error) {
} }
s.Running = true s.Running = true
go func() { go func() {
ds := DebugScanner{Silent: true} ds := DebugScanner{Silent: s.Debug}
ds.Scan(s.outputStream) ds.Scan(s.outputStream)
}() }()
go func() { go func() {
ds := DebugScanner{Silent: true} ds := DebugScanner{Silent: s.Debug}
ds.Scan(s.errorStream) ds.Scan(s.errorStream)
}() }()
go func() { go func() {

Loading…
Cancel
Save