2020-02-07 00:35:46 +03:00
|
|
|
package logger
|
|
|
|
|
2020-02-07 00:39:08 +03:00
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
)
|
2020-02-07 00:35:46 +03:00
|
|
|
|
|
|
|
// Option for load profiles maybe
|
|
|
|
// eg. yml
|
|
|
|
// micro:
|
|
|
|
// logger:
|
|
|
|
// name:
|
|
|
|
// dialect: zap/default/logrus
|
|
|
|
// zap:
|
|
|
|
// xxx:
|
|
|
|
// logrus:
|
|
|
|
// xxx:
|
|
|
|
type Option func(*Options)
|
|
|
|
|
|
|
|
type Options struct {
|
2020-02-20 11:26:12 +03:00
|
|
|
// The Log Level
|
|
|
|
Level Level
|
|
|
|
// Other opts
|
2020-02-07 00:35:46 +03:00
|
|
|
Context context.Context
|
|
|
|
}
|
2020-02-20 11:26:12 +03:00
|
|
|
|
|
|
|
// WithLevel sets the log level
|
|
|
|
func WithLevel(l Level) Option {
|
|
|
|
return func(o *Options) {
|
|
|
|
o.Level = l
|
|
|
|
}
|
|
|
|
}
|