Skip to content

Commit 54ae9ef

Browse files
author
Florian
committed
Removed unneccessary extra fixes in stdout_logger
1 parent 5337e69 commit 54ae9ef

1 file changed

Lines changed: 2 additions & 30 deletions

File tree

pkg/util/log/stdout_logger.go

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -244,19 +244,7 @@ func (s *stdoutLogger) Fatal(args ...interface{}) {
244244
s.logMutex.Lock()
245245
defer s.logMutex.Unlock()
246246

247-
if s.loadingText != nil {
248-
s.loadingText.Stop()
249-
s.loadingText = nil
250-
}
251-
252-
fnInformation := fnTypeInformationMap[fatalFn]
253-
254-
ct.Foreground(fnInformation.color, false)
255-
fnInformation.stream.Write([]byte(fnInformation.tag))
256-
257-
ct.ResetColor()
258-
fnInformation.stream.Write([]byte(fmt.Sprintln(args...)))
259-
247+
s.writeMessage(fatalFn, fmt.Sprintln(args...))
260248
s.writeMessageToFileLogger(fatalFn, args...)
261249

262250
if s.fileLogger == nil {
@@ -268,18 +256,7 @@ func (s *stdoutLogger) Fatalf(format string, args ...interface{}) {
268256
s.logMutex.Lock()
269257
defer s.logMutex.Unlock()
270258

271-
if s.loadingText != nil {
272-
s.loadingText.Stop()
273-
s.loadingText = nil
274-
}
275-
276-
fnInformation := fnTypeInformationMap[fatalFn]
277-
278-
ct.Foreground(fnInformation.color, false)
279-
fnInformation.stream.Write([]byte(fnInformation.tag))
280-
281-
ct.ResetColor()
282-
fnInformation.stream.Write([]byte(fmt.Sprintf(format, args...)))
259+
s.writeMessage(fatalFn, fmt.Sprintf(format, args...)+"\n")
283260
s.writeMessageToFileLoggerf(fatalFn, format, args...)
284261

285262
if s.fileLogger == nil {
@@ -291,11 +268,6 @@ func (s *stdoutLogger) Panic(args ...interface{}) {
291268
s.logMutex.Lock()
292269
defer s.logMutex.Unlock()
293270

294-
if s.loadingText != nil {
295-
s.loadingText.Stop()
296-
s.loadingText = nil
297-
}
298-
299271
s.writeMessage(panicFn, fmt.Sprintln(args...))
300272
s.writeMessageToFileLogger(panicFn, args...)
301273

0 commit comments

Comments
 (0)