Tidy up log package
This commit is contained in:
parent
e86857bdf7
commit
e599497728
1 changed files with 3 additions and 2 deletions
|
@ -183,7 +183,6 @@ func WithFields(fields map[string]interface{}) *logrus.Entry {
|
||||||
|
|
||||||
// New returns a new Logger instance.
|
// New returns a new Logger instance.
|
||||||
func New() *Logger {
|
func New() *Logger {
|
||||||
|
|
||||||
return &Logger{
|
return &Logger{
|
||||||
&logrus.Logger{
|
&logrus.Logger{
|
||||||
Out: os.Stderr,
|
Out: os.Stderr,
|
||||||
|
@ -218,7 +217,9 @@ func (l *Logger) SetLevel(v string) {
|
||||||
func (l *Logger) SetFormat(v string) {
|
func (l *Logger) SetFormat(v string) {
|
||||||
switch v {
|
switch v {
|
||||||
case "json":
|
case "json":
|
||||||
l.Formatter = &logrus.JSONFormatter{}
|
l.Formatter = &logrus.JSONFormatter{
|
||||||
|
TimestampFormat: time.RFC3339,
|
||||||
|
}
|
||||||
case "text":
|
case "text":
|
||||||
l.Formatter = &TextFormatter{
|
l.Formatter = &TextFormatter{
|
||||||
TimestampFormat: time.RFC3339,
|
TimestampFormat: time.RFC3339,
|
||||||
|
|
Loading…
Reference in a new issue