Skip to content

Commit

Permalink
support debug mode for logs collecting
Browse files Browse the repository at this point in the history
  • Loading branch information
kongfei605 committed Dec 4, 2023
1 parent dc8edde commit bcb6494
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions logs/processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ package processor

import (
"context"
"fmt"
"log"
"os"
"sync"

coreconfig "flashcat.cloud/categraf/config"
logsconfig "flashcat.cloud/categraf/config/logs"
"flashcat.cloud/categraf/logs/diagnostic"
"flashcat.cloud/categraf/logs/message"
Expand Down Expand Up @@ -94,6 +97,9 @@ func (p *Processor) processMessage(msg *message.Message) {
log.Println("unable to encode msg ", err)
return
}
if coreconfig.Config.DebugMode {
fmt.Fprintf(os.Stdout, "D! log item: %s", string(content))
}
msg.Content = content
p.outputChan <- msg
}
Expand Down

0 comments on commit bcb6494

Please sign in to comment.