mirror of
https://github.com/go-micro/go-micro.git
synced 2025-06-12 22:07:47 +02:00
various fixes (#1267)
* logger: remove Panic log level Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server/grpc: add missing Unlock in Subscribe error Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server: minor code change Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server/grpc: extend test suite with pub/sub testing Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server/grpc: fix invalid check and allow subscriber error to be returned Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * server/grpc: add pubsub tests Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org> * client/grpc: check for nil req/rsp Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
@ -16,8 +16,6 @@ const (
|
||||
WarnLevel
|
||||
// ErrorLevel level. Logs. Used for errors that should definitely be noted.
|
||||
ErrorLevel
|
||||
// PanicLevel level, logs the message and then panics.
|
||||
PanicLevel
|
||||
// FatalLevel level. Logs and then calls `logger.Exit(1)`. highest level of severity.
|
||||
FatalLevel
|
||||
)
|
||||
@ -34,8 +32,6 @@ func (l Level) String() string {
|
||||
return "warn"
|
||||
case ErrorLevel:
|
||||
return "error"
|
||||
case PanicLevel:
|
||||
return "panic"
|
||||
case FatalLevel:
|
||||
return "fatal"
|
||||
}
|
||||
@ -61,12 +57,10 @@ func GetLevel(levelStr string) (Level, error) {
|
||||
return WarnLevel, nil
|
||||
case ErrorLevel.String():
|
||||
return ErrorLevel, nil
|
||||
case PanicLevel.String():
|
||||
return PanicLevel, nil
|
||||
case FatalLevel.String():
|
||||
return FatalLevel, nil
|
||||
}
|
||||
return InfoLevel, fmt.Errorf("Unknown Level String: '%s', defaulting to NoLevel", levelStr)
|
||||
return InfoLevel, fmt.Errorf("Unknown Level String: '%s', defaulting to InfoLevel", levelStr)
|
||||
}
|
||||
|
||||
func Info(args ...interface{}) {
|
||||
@ -109,14 +103,6 @@ func Errorf(template string, args ...interface{}) {
|
||||
DefaultLogger.Logf(ErrorLevel, template, args...)
|
||||
}
|
||||
|
||||
func Panic(args ...interface{}) {
|
||||
DefaultLogger.Log(PanicLevel, args...)
|
||||
}
|
||||
|
||||
func Panicf(template string, args ...interface{}) {
|
||||
DefaultLogger.Logf(PanicLevel, template, args...)
|
||||
}
|
||||
|
||||
func Fatal(args ...interface{}) {
|
||||
DefaultLogger.Log(FatalLevel, args...)
|
||||
}
|
||||
|
Reference in New Issue
Block a user