Remove old comments, dead code

This commit is contained in:
Yoann La Cancellera
2023-11-13 21:31:22 +01:00
committed by Sveta Smirnova
parent ad91b7d407
commit 7876a0511c
4 changed files with 12 additions and 17 deletions

View File

@@ -23,15 +23,20 @@ func (c *ctx) Run() error {
return err
}
fmt.Println(translate.DBToJson())
out := struct {
DB any
Contexts []any
}{}
out.DB = translate.GetDB()
for _, t := range timeline {
out, err := json.MarshalIndent(t[len(t)-1].Ctx, "", "\t")
if err != nil {
return err
}
fmt.Println(string(out))
out.Contexts = append(out.Contexts, t[len(t)-1].Ctx)
}
outjson, err := json.MarshalIndent(out, "", "\t")
if err != nil {
return err
}
fmt.Println(string(outjson))
return nil
}

View File

@@ -192,14 +192,12 @@ func iterateOnGrepResults(path string, regexes types.RegexMap, grepStdout <-chan
// If it's recentEnough, it means we already validated a log: every next logs necessarily happened later
// this is useful because not every logs have a date attached, and some without date are very useful
//if !recentEnough && CLI.Since != nil && (!foundDate || (foundDate && CLI.Since.After(date.Time))) {
if CLI.Since != nil && CLI.Since.After(timestamp) {
continue
}
if CLI.Until != nil && CLI.Until.Before(timestamp) {
return lt
}
// recentEnough = true
filetype := regex.FileType(line, CLI.PxcOperator)
ctx.FileType = filetype

View File

@@ -93,11 +93,6 @@ func NoDatesRegex(skipLeadingCircumflex bool) string {
return "^(?![0-9]{4})"
}
/*
SYSLOG_DATE="\(Jan\|Feb\|Mar\|Apr\|May\|Jun\|Jul\|Aug\|Sep\|Oct\|Nov\|Dec\) \( \|[0-9]\)[0-9] [0-9]\{2\}:[0-9]\{2\}:[0-9]\{2\}"
REGEX_LOG_PREFIX="$REGEX_DATE \?[0-9]* "
*/
const k8sprefix = `{"log":"`
func SearchDateFromLog(logline string) (time.Time, string, bool) {

View File

@@ -19,10 +19,7 @@ var (
ctx.SetState(newState)
if newState == "DONOR" || newState == "JOINER" {
shiftTimestamp, _, ok := SearchDateFromLog(log)
if ok {
ctx.ConfirmSSTMetadata(shiftTimestamp)
}
ctx.ConfirmSSTMetadata(date)
}
log = utils.PaintForState(submatches["state1"], submatches["state1"]) + " -> " + utils.PaintForState(submatches["state2"], submatches["state2"])