1
0
Fork 0
mirror of https://github.com/postmannen/ctrl.git synced 2024-12-14 12:37:31 +00:00

fixed output of error logging

This commit is contained in:
postmannen 2023-01-12 07:12:35 +01:00
parent 807455119c
commit aa925329f7
2 changed files with 16 additions and 15 deletions

View file

@ -145,13 +145,13 @@ func (e *errorKernel) start(ringBufferBulkInCh chan<- []subjectAndMessage) error
switch errEvent.logLevel {
case logError:
slog.Error("%v\n", fmt.Errorf("%v", er), "error")
slog.Error("error", fmt.Errorf("%v", er))
case logInfo:
slog.Info("%v\n", er)
slog.Info(er)
case logWarning:
slog.Warn("%v\n", er)
slog.Warn(er)
case logDebug:
slog.Debug("%v\n", er)
slog.Debug(er)
case logNone:
// Do nothing for type logNone errors.
}
@ -272,7 +272,7 @@ func (e *errorKernel) infoSend(proc process, msg Message, err error) {
func (e *errorKernel) logConsoleOnlyIfDebug(err error, c *Configuration) {
if c.EnableDebug {
log.Printf("%v\n", err)
slog.Debug(err.Error())
}
}

View file

@ -842,18 +842,19 @@ func (p process) publishMessages(natsConn *nats.Conn) {
select {
case <-ticker.C:
// We only want to remove subprocesses
if p.isSubProcess {
p.processes.active.mu.Lock()
p.ctxCancel()
delete(p.processes.active.procNames, p.processName)
p.processes.active.mu.Unlock()
// REMOVED 120123: Removed if so all publishers should be canceled if inactive.
//if p.isSubProcess {
p.processes.active.mu.Lock()
p.ctxCancel()
delete(p.processes.active.procNames, p.processName)
p.processes.active.mu.Unlock()
er := fmt.Errorf("info: canceled publisher: %v", p.processName)
//sendErrorLogMessage(p.toRingbufferCh, Node(p.node), er)
log.Printf("%v\n", er)
er := fmt.Errorf("info: canceled publisher: %v", p.processName)
//sendErrorLogMessage(p.toRingbufferCh, Node(p.node), er)
log.Printf("%v\n", er)
return
}
return
//}
case m := <-p.subject.messageCh:
ticker.Reset(time.Second * time.Duration(p.configuration.KeepPublishersAliveFor))