|
|
@ -49,6 +49,7 @@ func ParseLine(inputStr string, previousLine LogLine) (logLine LogLine, errorMsg
|
|
|
|
logLine = previousLine
|
|
|
|
logLine = previousLine
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: what happens when we have <> or when there are multiple comments
|
|
|
|
//TODO: what happens when we have <> or when there are multiple comments
|
|
|
|
|
|
|
|
//TODO: Refactor this! it is ugly
|
|
|
|
comment := getBraketedData(inputStr, "COMMENT")
|
|
|
|
comment := getBraketedData(inputStr, "COMMENT")
|
|
|
|
if comment != "" {
|
|
|
|
if comment != "" {
|
|
|
|
logLine.Comment = comment
|
|
|
|
logLine.Comment = comment
|
|
|
@ -56,6 +57,14 @@ func ParseLine(inputStr string, previousLine LogLine) (logLine LogLine, errorMsg
|
|
|
|
fmt.Println("Cleaned input string: ", inputStr)
|
|
|
|
fmt.Println("Cleaned input string: ", inputStr)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
comment = getBraketedData(inputStr, "QSL")
|
|
|
|
|
|
|
|
if comment != "" {
|
|
|
|
|
|
|
|
logLine.QSLmsg = comment
|
|
|
|
|
|
|
|
inputStr = strings.Replace(inputStr, "[" + comment + "]", "",1)
|
|
|
|
|
|
|
|
fmt.Println("Cleaned input string: ", inputStr)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
elements := strings.Fields(inputStr)
|
|
|
|
elements := strings.Fields(inputStr)
|
|
|
|
|
|
|
|
|
|
|
|
for _, element := range elements {
|
|
|
|
for _, element := range elements {
|
|
|
@ -110,6 +119,7 @@ func getBraketedData(value, braketType string) (text string) {
|
|
|
|
a := ""
|
|
|
|
a := ""
|
|
|
|
b := ""
|
|
|
|
b := ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO: refactor that as a switch statement to exclude non supported bracket types
|
|
|
|
if braketType == "COMMENT" {
|
|
|
|
if braketType == "COMMENT" {
|
|
|
|
a = "<"
|
|
|
|
a = "<"
|
|
|
|
b = ">"
|
|
|
|
b = ">"
|
|
|
|