remove DEBUG logs
This commit is contained in:
parent
fde291c1ff
commit
d90e88d5eb
@ -47,7 +47,6 @@ func createDB(path string) *WriteDB {
|
|||||||
|
|
||||||
func (c *Conf) DatabaseManager() {
|
func (c *Conf) DatabaseManager() {
|
||||||
logDB, flushDB := c.RotateDB(true)
|
logDB, flushDB := c.RotateDB(true)
|
||||||
log.Print("DEBUG startup finished, managing logs!")
|
|
||||||
c.manageLogs(logDB, flushDB)
|
c.manageLogs(logDB, flushDB)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,7 +119,6 @@ func (c *Conf) RotateDB(startup bool) (*WriteDB, *WriteDB) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func rotateDB(c *Conf, logDec *gob.Decoder, flushDec *gob.Decoder, logEnc *gob.Encoder, startup bool) {
|
func rotateDB(c *Conf, logDec *gob.Decoder, flushDec *gob.Decoder, logEnc *gob.Encoder, startup bool) {
|
||||||
log.Println("DEBUG rotating db")
|
|
||||||
// This extra code is made to warn only one time for each non-existant filter
|
// This extra code is made to warn only one time for each non-existant filter
|
||||||
type SF struct{ s, f string }
|
type SF struct{ s, f string }
|
||||||
discardedEntries := make(map[SF]int)
|
discardedEntries := make(map[SF]int)
|
||||||
@ -167,10 +165,8 @@ func rotateDB(c *Conf, logDec *gob.Decoder, flushDec *gob.Decoder, logEnc *gob.E
|
|||||||
}
|
}
|
||||||
|
|
||||||
// store
|
// store
|
||||||
log.Printf("DEBUG got flush: %v", entry.Pattern)
|
|
||||||
flushes[PSF{entry.Pattern, entry.Stream, entry.Filter}] = entry.T
|
flushes[PSF{entry.Pattern, entry.Stream, entry.Filter}] = entry.T
|
||||||
}
|
}
|
||||||
log.Printf("DEBUG flushes: %v", flushes)
|
|
||||||
|
|
||||||
now := time.Now()
|
now := time.Now()
|
||||||
for {
|
for {
|
||||||
@ -201,14 +197,12 @@ func rotateDB(c *Conf, logDec *gob.Decoder, flushDec *gob.Decoder, logEnc *gob.E
|
|||||||
entryTime := entry.T.Unix()
|
entryTime := entry.T.Unix()
|
||||||
|
|
||||||
if lastLocalFlush > entryTime || lastGlobalFlush > entryTime {
|
if lastLocalFlush > entryTime || lastGlobalFlush > entryTime {
|
||||||
log.Printf("DEBUG got %v (exec:%v) but it has been flushed\n", entry.Pattern, entry.Exec)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// store matches
|
// store matches
|
||||||
if !entry.Exec && entry.T.Add(filter.retryDuration).Unix() > now.Unix() {
|
if !entry.Exec && entry.T.Add(filter.retryDuration).Unix() > now.Unix() {
|
||||||
log.Printf("DEBUG got match: %v\n", entry.Pattern)
|
|
||||||
if startup {
|
if startup {
|
||||||
filter.matches[entry.Pattern] = append(filter.matches[entry.Pattern], entry.T)
|
filter.matches[entry.Pattern] = append(filter.matches[entry.Pattern], entry.T)
|
||||||
}
|
}
|
||||||
@ -218,7 +212,6 @@ func rotateDB(c *Conf, logDec *gob.Decoder, flushDec *gob.Decoder, logEnc *gob.E
|
|||||||
|
|
||||||
// replay executions
|
// replay executions
|
||||||
if entry.Exec && entry.T.Add(*filter.longuestActionDuration).Unix() > now.Unix() {
|
if entry.Exec && entry.T.Add(*filter.longuestActionDuration).Unix() > now.Unix() {
|
||||||
log.Printf("DEBUG got exec: %v\n", entry.Pattern)
|
|
||||||
if startup {
|
if startup {
|
||||||
delete(filter.matches, entry.Pattern)
|
delete(filter.matches, entry.Pattern)
|
||||||
filter.execActions(entry.Pattern, now.Sub(entry.T))
|
filter.execActions(entry.Pattern, now.Sub(entry.T))
|
||||||
|
Loading…
Reference in New Issue
Block a user