@@ -24,18 +24,18 @@ type Context struct {
2424 values map [string ]interface {}
2525}
2626
27- // NewOption defines a function that can be used to customize a logger.
28- type NewOption func (l * Logger )
27+ // LoggerOption defines a function that can be used to customize a logger.
28+ type LoggerOption func (l * Logger )
2929
3030// WithWriter customizes the writer used by a logger.
31- func WithWriter (w io.Writer ) NewOption {
31+ func WithWriter (w io.Writer ) LoggerOption {
3232 return func (l * Logger ) {
3333 l .out = w
3434 }
3535}
3636
3737// WithTimestamp customizes the timestamp used by a logger.
38- func WithTimestamp (t time.Time ) NewOption {
38+ func WithTimestamp (t time.Time ) LoggerOption {
3939 return func (l * Logger ) {
4040 l .timestamp = t .UnixNano () / int64 (time .Millisecond )
4141 }
@@ -46,7 +46,7 @@ func WithTimestamp(t time.Time) NewOption {
4646// - Context based on Lambda environment variables.
4747// - Timestamp set to the time when NewWith was called.
4848// Specify NewOptions to customize the logger.
49- func NewWith (opts ... NewOption ) * Logger {
49+ func New (opts ... LoggerOption ) * Logger {
5050 values := make (map [string ]interface {})
5151
5252 // set default properties for lambda function
@@ -80,18 +80,6 @@ func NewWith(opts ...NewOption) *Logger {
8080 return l
8181}
8282
83- // New creates logger printing to os.Stdout, perfect for Lambda functions.
84- // Deprecated: use NewWith instead.
85- func New () * Logger {
86- return NewWith (WithWriter (os .Stdout ))
87- }
88-
89- // NewFor creates logger printing to any suitable writer.
90- // Deprecated: use NewWith and WithWriter instead.
91- func NewFor (out io.Writer ) * Logger {
92- return NewWith (WithWriter (out ))
93- }
94-
9583// Dimension helps builds DimensionSet.
9684type Dimension struct {
9785 Key , Value string
0 commit comments