diff --git a/rules.go b/rules.go index b772c4e..b5b9e33 100644 --- a/rules.go +++ b/rules.go @@ -7,6 +7,7 @@ import ( func resetMsgParsingRules() error { var rules, rules2 []MessageParsingRule + var count int64 b, err := Asset("data/msg_rules.json") logOnError(err, "resetMsgParsingRules : load data/msg_rules.json") @@ -52,6 +53,7 @@ func resetMsgParsingRules() error { return err } defer stmt.Close() + count = 0 for _, r2 := range rules2 { _, err = stmt.Exec(r2.Priority, r2.MsgTypeID64, r2.Description, r2.Rule) @@ -59,9 +61,12 @@ func resetMsgParsingRules() error { if err != nil { return err } + count += 1 } + fmt.Printf("resetMsgParsingRules : %d rules loaded.\n", count) + return nil }