Correct logic where we add a space after the prefix when logging

This commit is contained in:
Christian Rocha
2021-03-01 18:05:53 -05:00
parent fbd32c6eee
commit cd676fab5a

View File

@@ -29,7 +29,7 @@ func LogToFile(path string, prefix string) (*os.File, error) {
// doesn't already have a trailing space.
if len(prefix) > 0 {
finalChar := prefix[len(prefix)-1]
if unicode.IsSpace(rune(finalChar)) {
if !unicode.IsSpace(rune(finalChar)) {
prefix += " "
}
}