feat: more info logs
This commit is contained in:
parent
f665e5b2b1
commit
9800becc96
|
@ -122,13 +122,16 @@ func parseConfFile(path string) (conf Conf, err error) {
|
|||
}
|
||||
|
||||
func msgToConf(metaConfPath string, msg string) (conf Conf, err error) {
|
||||
slog.Info("msg to conf", "msg", msg)
|
||||
metaConf, err := parseMetaConfFile(metaConfPath)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
for _, pattern := range metaConf.Patterns {
|
||||
if matched, _ := regexp.MatchString(pattern.Regex, msg); matched {
|
||||
slog.Debug("pattern matched", "pattern", pattern)
|
||||
slog.Debug("pattern matched",
|
||||
"pattern", pattern, "filename", pattern.Filename)
|
||||
slog.Info("pattern matched", "filename", pattern.Filename)
|
||||
return parseConfFile(pattern.Filename)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,6 @@ package keyword
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"strings"
|
||||
|
||||
"focs.ji.sjtu.edu.cn/git/FOCS-dev/JOJ3/internal/stage"
|
||||
|
@ -31,7 +30,6 @@ func Parse(executorResult stage.ExecutorResult, conf Conf) (
|
|||
matched := false
|
||||
for _, file := range conf.Files {
|
||||
content := executorResult.Files[file]
|
||||
slog.Debug("file content", "file", file, "content", content)
|
||||
for _, match := range conf.Matches {
|
||||
count := strings.Count(content, match.Keyword)
|
||||
if count > 0 {
|
||||
|
|
|
@ -10,7 +10,8 @@ func Run(stages []Stage) (stageResults []StageResult, err error) {
|
|||
var parserResults []ParserResult
|
||||
var forceQuit bool
|
||||
for _, stage := range stages {
|
||||
slog.Debug("stage start", "name", stage.Name)
|
||||
slog.Info("stage start", "name", stage.Name)
|
||||
slog.Info("executor run start")
|
||||
slog.Debug("executor run start", "cmds", stage.ExecutorCmds)
|
||||
executor, ok := executorMap[stage.ExecutorName]
|
||||
if !ok {
|
||||
|
@ -24,6 +25,7 @@ func Run(stages []Stage) (stageResults []StageResult, err error) {
|
|||
return
|
||||
}
|
||||
slog.Debug("executor run done", "results", executorResults)
|
||||
slog.Info("parser run start")
|
||||
slog.Debug("parser run start", "conf", stage.ParserConf)
|
||||
parser, ok := parserMap[stage.ParserName]
|
||||
if !ok {
|
||||
|
|
Loading…
Reference in New Issue
Block a user