Skip to content

Commit fd95db8

Browse files
committed
fix: improve error handling and logging mechanisms
- Add `os.Exit(1)` call to the `Fatal` method in `defaultLogger` to ensure the program exits after logging a fatal error Signed-off-by: appleboy <[email protected]>
1 parent 67990e1 commit fd95db8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

logger.go

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ func (l defaultLogger) Error(args ...interface{}) {
5353

5454
func (l defaultLogger) Fatal(args ...interface{}) {
5555
l.fatalLogger.Println(fmt.Sprint(args...))
56+
os.Exit(1)
5657
}
5758

5859
// NewEmptyLogger for simple logger.

0 commit comments

Comments
 (0)