Skip to content

Commit

Permalink
Refactor Plainf method in logger.go to print each line separately
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitpaulk committed May 21, 2024
1 parent 39db270 commit 36319ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ func (l *Logger) Debugln(msg string) {
}

func (l *Logger) Plainf(fstring string, args ...interface{}) {
l.logger.Printf(fstring, args...)
formattedString := fmt.Sprintf(fstring, args...)

for _, line := range strings.Split(formattedString, "\n") {
l.logger.Println(line)
}
}

func (l *Logger) Plainln(msg string) {
Expand Down

0 comments on commit 36319ad

Please sign in to comment.