os.Exit on log.Fatal (#1316)
* os.Exit on log.Fatal * Fix TestOptions Co-authored-by: Ben Toogood <ben@micro.mu>
This commit is contained in:
		| @@ -1,6 +1,9 @@ | ||||
| package logger | ||||
|  | ||||
| import "fmt" | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"os" | ||||
| ) | ||||
|  | ||||
| type Level int8 | ||||
|  | ||||
| @@ -105,8 +108,10 @@ func Errorf(template string, args ...interface{}) { | ||||
|  | ||||
| func Fatal(args ...interface{}) { | ||||
| 	DefaultLogger.Log(FatalLevel, args...) | ||||
| 	os.Exit(1) | ||||
| } | ||||
|  | ||||
| func Fatalf(template string, args ...interface{}) { | ||||
| 	DefaultLogger.Logf(FatalLevel, template, args...) | ||||
| 	os.Exit(1) | ||||
| } | ||||
|   | ||||
| @@ -156,7 +156,7 @@ func TestOptions(t *testing.T) { | ||||
| 		name             = "service-name" | ||||
| 		id               = "service-id" | ||||
| 		version          = "service-version" | ||||
| 		address          = "service-addr" | ||||
| 		address          = "service-addr:8080" | ||||
| 		advertise        = "service-adv" | ||||
| 		reg              = memory.NewRegistry() | ||||
| 		registerTTL      = 123 * time.Second | ||||
|   | ||||
		Reference in New Issue
	
	Block a user