Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-Morgan committed Oct 22, 2024
1 parent 3b8edf0 commit 22b3510
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 11 deletions.
2 changes: 0 additions & 2 deletions logrus/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,5 @@ type Logger = logrus.Logger

// NewLogger create a logger
func NewLogger(opts ...Option) *Logger {

return logrus.NewLogger(opts...)

}
2 changes: 0 additions & 2 deletions slog/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ const (
var _ hlog.FullLogger = (*Logger)(nil)

func NewLogger(opts ...Option) *Logger {

return cwslog.NewLogger(opts...)

}

type (
Expand Down
1 change: 0 additions & 1 deletion slog/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ type config struct {
}

func defaultConfig() *config {

return &config{
options: []cwslog.Option{},
}
Expand Down
1 change: 0 additions & 1 deletion zap/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,5 @@ var _ hlog.FullLogger = (*Logger)(nil)
type Logger = cwzap.Logger

func NewLogger(opts ...Option) *Logger {

return cwzap.NewLogger(opts...)
}
4 changes: 2 additions & 2 deletions zerolog/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
package zerolog

import (
"io"

cwzerolog "github.com/cloudwego-contrib/cwgo-pkg/log/logging/zerolog"
"github.com/cloudwego/hertz/pkg/common/hlog"
"github.com/rs/zerolog"
"io"
)

var _ hlog.FullLogger = (*Logger)(nil)
Expand Down Expand Up @@ -49,6 +50,5 @@ func From(log zerolog.Logger, options ...Opt) *Logger {

// GetLogger returns the default logger instance
func GetLogger() (Logger, error) {

return cwzerolog.GetLogger()
}
7 changes: 4 additions & 3 deletions zerolog/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
package zerolog

import (
cwzerolog "github.com/cloudwego-contrib/cwgo-pkg/log/logging/zerolog"
"io"

cwzerolog "github.com/cloudwego-contrib/cwgo-pkg/log/logging/zerolog"

"github.com/cloudwego/hertz/pkg/common/hlog"
"github.com/rs/zerolog"
)
Expand All @@ -35,7 +36,7 @@ func WithOutput(out io.Writer) Opt {

// WithLevel allows to specify the level of the logger. By default, it is set to WarnLevel.
func WithLevel(level hlog.Level) Opt {
//lvl := matchHlogLevel(level)
// lvl := matchHlogLevel(level)
return cwzerolog.WithLevel(level)
}

Expand All @@ -56,7 +57,7 @@ func WithTimestamp() Opt {

// WithFormattedTimestamp adds a formatted timestamp field to the logger's context
func WithFormattedTimestamp(format string) Opt {
//zerolog.TimeFieldFormat = format
// zerolog.TimeFieldFormat = format
return cwzerolog.WithFormattedTimestamp(format)
}

Expand Down

0 comments on commit 22b3510

Please sign in to comment.