mirror of
https://github.com/postmannen/ctrl.git
synced 2024-12-14 12:37:31 +00:00
removed debug print statements
This commit is contained in:
parent
dc10757e62
commit
e33fba19e1
7 changed files with 7 additions and 21 deletions
|
@ -1,7 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
|
@ -54,7 +53,7 @@ func main() {
|
|||
|
||||
// Block and wait for CTRL+C
|
||||
sig := <-sigCh
|
||||
fmt.Printf("Got exit signal, terminating all processes, %v\n", sig)
|
||||
log.Printf("Got exit signal, terminating all processes, %v\n", sig)
|
||||
|
||||
// Adding a safety function here so we can make sure that all processes
|
||||
// are stopped after a given time if the context cancelation hangs.
|
||||
|
|
|
@ -147,7 +147,6 @@ func (p *processes) Start(proc process) {
|
|||
// Stop all subscriber processes.
|
||||
func (p *processes) Stop() {
|
||||
log.Printf("info: canceling all subscriber processes...\n")
|
||||
fmt.Printf("* DEBUG: %v\n", p.wg)
|
||||
p.cancel()
|
||||
p.wg.Wait()
|
||||
log.Printf("info: done canceling all subscriber processes.\n")
|
||||
|
|
|
@ -261,7 +261,6 @@ func (s *server) checkMessageToNodes(MsgSlice []Message) []Message {
|
|||
// if toNodes specified, we use the original message, and
|
||||
// create new node messages for each of the nodes specified.
|
||||
case len(v.ToNodes) != 0:
|
||||
fmt.Printf("\n * Found TonNodes: %#v\n\n", len(v.ToNodes))
|
||||
for _, n := range v.ToNodes {
|
||||
m := v
|
||||
// Set the toNodes field to nil since we're creating
|
||||
|
|
12
requests.go
12
requests.go
|
@ -270,9 +270,6 @@ func newReplyMessage(proc process, message Message, outData []byte) {
|
|||
message.ReplyMethod = REQToFileAppend
|
||||
}
|
||||
|
||||
fmt.Printf("\n * DEBUG * newReplyMessage: message.FromNode contains: %v\n", message.FromNode)
|
||||
fmt.Printf("\n * DEBUG * newReplyMessage: message.ToNode contains: %v\n", message.ToNode)
|
||||
|
||||
// Create a new message for the reply, and put it on the
|
||||
// ringbuffer to be published.
|
||||
newMsg := Message{
|
||||
|
@ -638,7 +635,6 @@ func (m methodREQOpProcessStop) handler(proc process, message Message, node stri
|
|||
// that publisher processes are named by the node they are sending the
|
||||
// message to. Subscriber processes names are named by the node name
|
||||
// they are running on.
|
||||
fmt.Printf(" * DEBUG : %v\n", message.MethodArgs)
|
||||
methodString := message.MethodArgs[0]
|
||||
node := message.MethodArgs[1]
|
||||
kind := message.MethodArgs[2]
|
||||
|
@ -668,9 +664,7 @@ func (m methodREQOpProcessStop) handler(proc process, message Message, node stri
|
|||
// We can then use this processName to get the real values for the
|
||||
// actual process we want to stop.
|
||||
sub := newSubject(method, string(node))
|
||||
fmt.Printf(" * DEBUG : sub: %v\n", sub)
|
||||
processName := processNameGet(sub.name(), processKind(kind))
|
||||
fmt.Printf(" * DEBUG : processName: %v\n", processName)
|
||||
|
||||
proc.processes.mu.Lock()
|
||||
|
||||
|
@ -1075,8 +1069,6 @@ func (m methodREQCliCommand) handler(proc process, message Message, node string)
|
|||
go func() {
|
||||
defer proc.processes.wg.Done()
|
||||
|
||||
fmt.Printf("* DEBUG * handler: received message contains : %#v\n", message)
|
||||
|
||||
c := message.MethodArgs[0]
|
||||
a := message.MethodArgs[1:]
|
||||
|
||||
|
@ -1110,7 +1102,6 @@ func (m methodREQCliCommand) handler(proc process, message Message, node string)
|
|||
if foundEnvData {
|
||||
envData = fmt.Sprintf("STEWARD_DATA=%v", envData)
|
||||
cmd.Env = append(cmd.Env, envData)
|
||||
fmt.Printf("\n * DEBUG * cmd.Env contains: %v\n\n", cmd.Env)
|
||||
}
|
||||
|
||||
var out bytes.Buffer
|
||||
|
@ -1174,7 +1165,6 @@ func (m methodREQToConsole) getKind() CommandOrEvent {
|
|||
|
||||
// Handler to write directly to console.
|
||||
func (m methodREQToConsole) handler(proc process, message Message, node string) ([]byte, error) {
|
||||
fmt.Printf("<--- methodCLICommandReply: %v\n", message.Data)
|
||||
|
||||
ackMsg := []byte("confirmed from: " + node + ": " + fmt.Sprint(message.ID))
|
||||
return ackMsg, nil
|
||||
|
@ -1483,7 +1473,7 @@ func (m methodREQToSocket) getKind() CommandOrEvent {
|
|||
func (m methodREQToSocket) handler(proc process, message Message, node string) ([]byte, error) {
|
||||
|
||||
for _, d := range message.Data {
|
||||
// Write the data to the socket here.
|
||||
// TODO: Write the data to the socket here.
|
||||
fmt.Printf("Info: Data to write to socket: %v\n", d)
|
||||
}
|
||||
|
||||
|
|
|
@ -165,7 +165,6 @@ func (r *ringBuffer) fillBuffer(ctx context.Context, inCh chan subjectAndMessage
|
|||
er := fmt.Errorf("error: fillBuffer: the event or command type do not exist, so this message will not be put on the buffer to be processed. Check the syntax used in the json file for the message. Allowed values are : %v, where given: coe=%v, with subject=%v", coeAvailableValues, v.CommandOrEvent, v.Subject)
|
||||
sendErrorLogMessage(r.configuration, r.metrics, r.newMessagesCh, Node(r.nodeName), er)
|
||||
|
||||
fmt.Println()
|
||||
// if it was not a valid value, we jump back up, and
|
||||
// continue the range iteration.
|
||||
continue
|
||||
|
|
|
@ -197,7 +197,7 @@ func NewServer(c *Configuration, version string) (*server, error) {
|
|||
// if there is publisher process for a given message subject, and
|
||||
// if it does not exist it will spawn one.
|
||||
func (s *server) Start() {
|
||||
fmt.Printf(" * VERSION = %+v\n", s.version)
|
||||
log.Printf("Starting steward, version=%+v\n", s.version)
|
||||
s.metrics.promVersion.With(prometheus.Labels{"version": string(s.version)})
|
||||
|
||||
// Start the error kernel that will do all the error handling
|
||||
|
|
Loading…
Reference in a new issue